Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix blank error pages when error.messages has no to_str
When an exception whose #messages attribute is not a string is rescued, Sinatra fails to display the error page due to a TypeError. The problem is that Ruby's + implementation uses type-strong coercing (#to_str) instead of type-weak coercision (#to_s). This just forces to_s to be used, avoiding the problem. (An example of this type of exception is DataMapper::Errors. It doesn't respond to #to_str)
- Loading branch information