Opened 7 years ago
Last modified 5 years ago
#17624 new feature
ContentPane: add onError() public method for notification of server side errors
Reported by: | Ian Phillips | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | Dijit | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If I open a Dialog using the "href" attribute, and the server generates an error (4xx or 5xx response code), the only option I have for presenting that error to the user is the "errorMessage" attribute -- not very flexible.
It would be nice to be able to do this:
var dialog = new Dialog({ href: uri, title: title, onError: function(response) { if ( response.statusCode < 500 ) /* a 4xx error */ { return response.status; // eg, "Bad request" } else /* a 5xx error */ { return "An unexpected error has occurred"; } } });
Change History (4)
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
Summary: | Allow dijit/Dialog to handle server side errors → ContentPane: add onError() public method for notification of server side errors |
---|
comment:3 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|
comment:4 Changed 5 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
Note: See
TracTickets for help on using
tickets.
Actually, Dialog extends ContentPane?, and ContentPane? has an _onError method. So you should be able to setup advice on _onError (
aspect.after(dialog, "_onError", ...)
). I agree it would be a little nicer if there was a public onError method that you could override.