Skip to content

errors don't set requireType #39

Closed

Description

@dgoldstein0

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?

Activity

  1. jrburke commented on Oct 29, 2017

    @jrburke
    Member

    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.

  2. dgoldstein0 commented on Oct 30, 2017

    @dgoldstein0
    Author

    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.

  3. jrburke commented on Nov 22, 2017

    @jrburke
    Member

    I was able to add some requireTypes to some errors in #41, including 'timeout', which is now released as alameda 1.2.1.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions