IDEA. consider using PromiseLike interface instead of Promise class · Issue #7 · snytkine/bind-rest · GitHub
More Web Proxy on the site http://driver.im/
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
This means that there will not be a .catch usage anywhere. Instead, the .then will accept a second function to handle error.
This way a middleware can have 2 functions: doFilter like it does not and onError(e: any) => Promise
One benefit is that errorFormatter becomes just a middleware instead of a function that goes inside .catch at the end.
Another benefit is that a middleware may exist somewhere in the middle of promise chain and be able to recover from error.
Another benefit is ability to switch to different Promise provider like BlueBird
The text was updated successfully, but these errors were encountered:
This means that there will not be a .catch usage anywhere. Instead, the .then will accept a second function to handle error.
This way a middleware can have 2 functions: doFilter like it does not and onError(e: any) => Promise
One benefit is that errorFormatter becomes just a middleware instead of a function that goes inside .catch at the end.
Another benefit is that a middleware may exist somewhere in the middle of promise chain and be able to recover from error.
Another benefit is ability to switch to different Promise provider like BlueBird
The text was updated successfully, but these errors were encountered: