Closed Kebap closed 3 years ago
This was the culprit:
"patterns": [
{
"pattern": "Du sagst:",
"type": "substring",
},
],
Note the trailing comma which seems fair in Lua but no-no in Json
Here is another strange exception message that did not help at all in identifying the error source. Can you guess it before looking below?
Exception reads:
Run demonnic/build-with-muddler@main
% Total % Received % Xferd Average Speed Time Time Time Current
Using Muddler version: 0.6
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 629 100 629 0 0 6353 0 --:--:-- --:--:-- --:--:-- 6353
3 18.0M 3 710k 0 0 3159k 0 0:00:05 --:--:-- 0:00:05 3159k
100 18.0M 100 18.0M 0 0 35.6M 0 --:--:-- --:--:-- --:--:-- 61.8M
[copy] Copying 8 files to /home/runner/work/mg-muddler/mg-muddler/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)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeJsonObject(JsonParserCharArray.java:128)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeValueInternal(JsonParserCharArray.java:182)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeJsonArray(JsonParserCharArray.java:322)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeValueInternal(JsonParserCharArray.java:178)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeJsonObject(JsonParserCharArray.java:128)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeValueInternal(JsonParserCharArray.java:182)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeJsonArray(JsonParserCharArray.java:322)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeValueInternal(JsonParserCharArray.java:178)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeValue(JsonParserCharArray.java:153)
at org.apache.groovy.json.internal.JsonParserCharArray.decodeFromChars(JsonParserCharArray.java:43)
at org.apache.groovy.json.internal.JsonParserCharArray.parse(JsonParserCharArray.java:380)
at org.apache.groovy.json.internal.BaseJsonParser.parse(BaseJsonParser.java:133)
at org.apache.groovy.json.internal.BaseJsonParser.parse(BaseJsonParser.java:156)
at groovy.json.JsonSlurper.parseFile(JsonSlurper.java:362)
at groovy.json.JsonSlurper.parse(JsonSlurper.java:345)
at groovy.json.JsonSlurper$parse.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
at muddler.mudlet.packages.Package$_createItems_closure3.doCall(Package.groovy:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1029)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:428)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2318)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2303)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2344)
at org.codehaus.groovy.runtime.dgm$200.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:247)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
at muddler.mudlet.packages.Package.createItems(Package.groovy:39)
at muddler.mudlet.packages.Package.<init>(Package.groovy:20)
at muddler.mudlet.packages.TriggerPackage.<init>(TriggerPackage.groovy:8)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:268)
at muddler.App.main(App.groovy:69)
Muddler build failed with exit status: 1
Error: Process completed with exit code 1.
Culprit was:
One new trigger in triggers.json received one new pattern of type regex (that is, in between lots other changes in the commit, so not easy to spot) which had this very pattern: ^Du hast \d* neuen? Briefe? im Postamt liegen\.$
This seems to not get recognized, even though neither \d or . are legit escape sequences in json. Probably every single \ needs to be escaped?
Testing with adjusted pattern ^Du hast \\d* neuen? Briefe? im Postamt liegen\\.$
seems to work fine then.
Looking back at the docs, escaping the / character in regex is indeed mentioned on Aliases wiki page, but is not on Triggers page, which is the item I tackled first instead. Obviously beginner error, as any json veteran would know to change the scring, but maybe could receive a noob friendly message instead of the gibberish exception?
Yeah, muddler currently doesn't really do any error handling. This seems as good a place as any to start on it. Thanks for the issue.
Fixed in 0.7
I ran muddler, obviously did some error with a bracket, but do not receive a file name for reference. Where should I start looking?
This is what I found: