HubSpot / messenger

Growl-style alerts and messages for your app. #hubspot-open-source
http://github.hubspot.com/messenger/
MIT License
4.02k stars 405 forks source link

Add a way to decide that a success is actually an error, or vice versa. #17

Open zackbloom opened 11 years ago

strongwazz commented 11 years ago

This feature would be a great addition.

Returning type:error from your success callback lets the message render correctly, but none of the retry functionality works (the xhr.status is obviously < 500).

return {
    type: 'error'
    , xhr: {
        status: 500
    }
}

So I don't think extending the xhr object is a good idea, but just as an example.

There's still a lot going on in run() I need to get my head around :)