make sure a message is a string

Another error happens when an error instance has no message.

"Object Error has no method 'replace'"