demonnic / muddler

A build tool for Mudlet package developers
MIT License
40 stars 12 forks source link

Catch exceptions and give better error messages (Mainly, file names) #6

Closed stridera closed 3 years ago

stridera commented 4 years ago

Got an error, but I wasn't sure where. Had to check all my json files to find the error.


Exception in thread "main" groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is ']' with an int value of 93
Unable to determine the current character, it is not a string, number, array, or object
line number 11
index number 165
]
^
        at org.apache.groovy.json.internal.JsonParserCharArray.decodeValueInternal(JsonParserCharArray.java:202)
        at org.apache.groovy.json.internal.JsonParserCharArray.decodeJsonArray(JsonParserCharArray.java:322)
        at org.apache.groovy.json.internal.JsonParserCharArray.decodeValueInternal(JsonParserCharArray.java:178)```
stridera commented 4 years ago

Another example:

 ± |master ?:3 ✗| → muddler.sh 
     [copy] Copying 22 files to /home/strider/Code/FierymudMudletClient/build/filtered/src
Exception in thread "main" groovy.json.JsonException: Unable to decode string
        at org.apache.groovy.json.internal.CharBuf.decodeJsonString(CharBuf.java:824)
        at org.apache.groovy.json.internal.JsonParserCharArray.decodeString(JsonParserCharArray.java:285)
        at org.apache.groovy.json.internal.JsonParserCharArray.decodeValueInternal(JsonParserCharArray.java:162)
demonnic commented 4 years ago

Yeah, I played a bit fast and loose with the code, should add more try/catch all around honestly.

Kebap commented 3 years ago

This has been improved with release 0.7 - give it a test and report back, if you need additional improvements 😉

demonnic commented 3 years ago

Also, sorry it took so long.

demonnic commented 3 years ago

mis-clicked.