“rejected promise” due to app.show()

Same problem as https://github.com/webix-hub/webix-jet/issues/28, any suggestion?
We tried to intercept this case into the App constructor using
- “onBeforeAjax” event handler with app.show(‘/logout’)
- and using “getStatus()” of UserPlugin with a app.show(‘/login’)) in .then()
but javascript errors occur (“rejected promise” due to app.show()) after “login” and “logout”.


  • Situation is the next

    • be default, the show command returns a promise
    • when show command is blocked by any means, this promise is rejected. It is not an error, just a signal that promise can't be fulfilled
    • when rejection of promise is not handled, browser will show the above error message

    So promise rejection is not a sign of error.
    To disable message you can

    • promise catch or finally handlers for the show command
    • use something like next
    window.Promise = webix.promise;

    which will replace default promise implementation with a custom one, which works the same but doesn't show error messages for unresolved promises. It can hide the other rejected promises, which you want to see, though, so it is not recommended.

  • What are the causes that can make an app.show() promise fail (when called in app constructor)?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion