You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in requirejs, module loading errors set a field requireType which says whether the load that failed was a require call or a define call. This field isn't set in Alameda's errors. I think that was an oversight?
Looking at requirejs, the requireType can be set to more than just "require' or 'define', can be other things like 'timeout', 'importscripts', 'fromtexteval', 'mismatch', a few other values.
It is also used to construct a help URL to requirejs.org. So some of those values will be specific to how requirejs operates internally.
alameda at the moment does not support it since it was not clear what sorts of error info was important in the alameda case, and there is no "error-to-help-url" setup for alameda at the moment.
If you think some extra info on the error would be helpful, then feel free to sketch out what that might be, and in what scenario the error might surface, so that a test case/code change could be constructed to validate the scenario.
hm. So the main thing I noticed is that my code was trying to use it to detect timeouts and treat them a little differently than other failures. For simplicity I realized I could just go the route of err.message.startsWith('Timeout for modules:'); but then when I went to test this workaround, I found more issues with timeout handling (#40)
re: what I want to know from errors... the main thing I want is to classify errors into 3 categories:
network / transient errors - since there's not much we can do if the user has a bad connection
errors in alameda itself
errors in code alameda loads (e.g. modules that throw when loaded)
and as a secondary concern, I'd also like some info to determine the impact of the error (i.e. whether it causes the page to be useless or is just some secondary functionality that is broken) - though I don't think alameda can be expected to provide this.
Activity
jrburke commentedon Oct 29, 2017
Looking at requirejs, the requireType can be set to more than just "require' or 'define', can be other things like 'timeout', 'importscripts', 'fromtexteval', 'mismatch', a few other values.
It is also used to construct a help URL to requirejs.org. So some of those values will be specific to how requirejs operates internally.
alameda at the moment does not support it since it was not clear what sorts of error info was important in the alameda case, and there is no "error-to-help-url" setup for alameda at the moment.
If you think some extra info on the error would be helpful, then feel free to sketch out what that might be, and in what scenario the error might surface, so that a test case/code change could be constructed to validate the scenario.
dgoldstein0 commentedon Oct 30, 2017
hm. So the main thing I noticed is that my code was trying to use it to detect timeouts and treat them a little differently than other failures. For simplicity I realized I could just go the route of
err.message.startsWith('Timeout for modules:'); but then when I went to test this workaround, I found more issues with timeout handling (#40)re: what I want to know from errors... the main thing I want is to classify errors into 3 categories:
and as a secondary concern, I'd also like some info to determine the impact of the error (i.e. whether it causes the page to be useless or is just some secondary functionality that is broken) - though I don't think alameda can be expected to provide this.
jrburke commentedon Nov 22, 2017
I was able to add some
requireTypes to some errors in #41, including 'timeout', which is now released as alameda 1.2.1.