make sure a message is a string

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