Use `{0!r}` to get the repr of the string in the error message.