Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail should be provided a map with error information as well as arguments bound. #4

Closed
james-jw opened this issue Nov 5, 2015 · 3 comments

Comments

@james-jw
Copy link
Owner

james-jw commented Nov 5, 2015

When a fail callback is called. It should be provided a single argument which is map that contains all the error information.

I propose:

map {
  'err': {
     'description': Same as standard error bindings
     ...
   },
  'args': array [ ... ]
}

This way, the fail callback has the information needed to either report a useful error, including the bad arguments or continue the work somehow.

@james-jw
Copy link
Owner Author

james-jw commented Nov 6, 2015

The work function should also be included, in case you want to do a retry.

map {
  'err': {
     'description': Same as standard error bindings
     ...
   },
  'args': array [ ... ]
  'deferred': function#
}

@ChristianGruen
Copy link

Related: W3 Bugzilla #29264, proposed by @apb2006.

@james-jw
Copy link
Owner Author

Fail is now provided a map as proposed by @apb2006!

The additional argument is populated with a map containing the deferred and the arguments. This will allow a callback to, for example retry if it gets a busy response.

Additionally error handing has been greatly improved. Errors are now properly reported in BaseX, as well as potential bugs. Also, the fail logic has been revised and properly documented in the ReadMe.

f06b682

c18ec61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants