Skip to content

Custom handling of 4xx, 5xx status responses #129

Description

@unirgy

Hello, my situation is: i'm using require.js to load json configurations, which are dynamically generated by a server script, but are inaccessible when there's no logged in session, and returns status 401. I'd like to capture this situation and redirect to login screen when this happens.

in the docs I've only found config.text.onXhrComplete, but the execution doesn't reach this callback if status is 4xx or 5xx. In the code I've found errback(err.xhr) and apparently it calls onLoad.error, but I can't find how to set this onLoad.error.

Is this implemented as configuration, or needs to be customized in core?

Thanks.

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