Closed asilvas closed 11 years ago
good catch @asilvas. seems like it's minor, but i'll take a look at it.
related to #144
Can't currently see a way to achieve what you're asking without breaking this:
curl(["pkg/modA"]).then(success, failure);
However, this is now working in dev branch:
curl(["pkg/modA"], null, function (error) { });
-- John
Makes sense, I cannot think of a good way around that one. An unfortunate issue, but not a big deal.
Assuming there is something wrong, anything that would result in a "curl" call failing, if no success callback is provided, it will fail silently. Can make debugging difficult, as it is not uncommon to load some modules without the need for a callback.
In other words, assuming "mod1.js" does not exist, the following code will fail silently (no console log):
However, this will log an exception to the console log (since an error callback is not provided), which makes a lot of sense:
And as you'd expect, if an error callback is provided, it will be invoked:
Minor, but would be nice if example 1 behaved like example 2, as in both cases an error callback is not provided, but we should know what went wrong.