Don't pass invalid JSON on errors