Feature request: allow to pass a plain Error instance to toastr.error() (and maybe to toastr() itself) that will properly display it as an error. IMHO this code looks intuitive enough but it wouldn't work right now:
toastr(new Error("my error")); // Does not work
toastr.error(new Error("my error")); // Also does not work
Edit: a big advantage of this is that you'd be able to simplify promise handling like:
mypromise.then(...).catch(toastr); // First case
mypromise.then(...).catch(toastr.error); // Second case
Feature request: allow to pass a plain
Error
instance totoastr.error()
(and maybe totoastr()
itself) that will properly display it as an error. IMHO this code looks intuitive enough but it wouldn't work right now:Edit: a big advantage of this is that you'd be able to simplify promise handling like:
Could be as easy as a well situated:
Or handling it lower in the chain, so that any
toastr.[whatever](new Error(...))
becomes an.error(...)
type: