JSON errors are sometimes IllegalStateExceptions. Fixes #43