Fix mug type conversion bug

Checking the exception message is not portable across different browsers (failed on Chrome, worked on Firefox).
Merge pull request #202 from dimagi/108638-type-change-fix

Fix mug type conversion bug