Skip to content

Commit

Permalink
add error info
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Nov 5, 2023
1 parent 3d2e622 commit fa0f55d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/com/alibaba/fastjson2/JSONReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,7 @@ public List readArray() {
skipComment();
continue;
default:
throw new JSONException("TODO : " + ch);
throw new JSONException(info());
}

if (i == 0) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.alibaba.fastjson2.issues_1900;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONException;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertThrows;

public class Issue1989 {
@Test
public void test() {
String paramStr = "{\n\"a\": \"\",\n\"b\": \"#b#\",\n\"d\": \"c\",\n\"d\": {\n\"f\": \"#f#\",\n\"g\": \"#g#\",\n\"h\": [\n \"j\":[] \n]\n}\n}";
assertThrows(
JSONException.class,
() -> JSON.parse(paramStr));
}
}

0 comments on commit fa0f55d

Please sign in to comment.