Skip to content

Commit

Permalink
more error info.
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed May 9, 2017
1 parent 9f8585e commit 69df5e9
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -64,7 +64,15 @@ public static Map parseMap(DefaultJSONParser parser, Map<String, Object> map, Ty
JSONLexer lexer = parser.lexer;

if (lexer.token() != JSONToken.LBRACE) {
throw new JSONException("syntax error, expect {, actual " + lexer.token());
String msg = "syntax error, expect {, actual " + lexer.tokenName();
if (fieldName instanceof String) {
msg += ", fieldName ";
msg += fieldName;
}
msg += ", ";
msg += lexer.info();

throw new JSONException(msg);
}

ParseContext context = parser.getContext();
Expand Down

0 comments on commit 69df5e9

Please sign in to comment.