Closed fuhbar closed 5 years ago
This somehow relates to issue #76 - at least the recent comments.
Nevertheless I opened a new issue because I am interested in the possibility of error handling at all and not in the discussion of API design mentioned in the quoted issue.
Ah. Right. I see the problem. That's a pretty big issue.
@moul suggest we find and replace in the codebase.
Search: , (data) => fn data if fn
and , (data) -> fn data if fn
, then replace with fn
Then change https://github.com/node-gitlab/node-gitlab/blob/develop/src/ApiBaseHTTP.coffee#L41 to handle cases when fn
is null.
What do you think?
Is this being looked at all anymore?
I thikn I'm having the same problem, it doesn't matter how many arguments I pass to my callback I only ever get the result in the first argument, so I'm unable to catch any errors.
I ended up just making calls directly to API with a simple little wrapper
Yeah, I might do the same, I'm also not sure when api v3 is going to be deprecated by gitlab.
It seems that a potential error returned by the remote HTTP endpoint is never returned to the caller.
The wrapper around slumber return errors only if the argument length (arity) of the callback is as expected: https://github.com/node-gitlab/node-gitlab/blob/develop/src/ApiBaseHTTP.coffee#L41-L47
But the callback evaluated there is not the one supplied by the user. Random samples of some central models support this thesis and show that only a wrapper is ever seen by the lines of code quoted above: https://github.com/node-gitlab/node-gitlab/blob/develop/src/Models/Projects.coffee#L42 (...) https://github.com/node-gitlab/node-gitlab/blob/develop/src/Models/Groups.coffee#L38 (...)
My question is therefore, how do I get notified in case of errors. I need to ensure that my operations placed at the remote gitlab instance were carry out succesfully.