Better exception message for flash errors

I can pull this out if I'm missing something, but it seems like we'd like to see if the message level is one of the known error types, rather than if one of the known error types is a substring of the message level.