added error variable
will use throw e for the stack trace dump
use error code property for error handling control flow.