fix error message rendering failing due to message being a dict

Not sure what the proper GitHub etiquette is as you have an open pull request against upstream, but you might want to include this commit in your pull request.