diff --git a/analyzer.go b/analyzer.go index b1c16d5..a7ceec7 100644 --- a/analyzer.go +++ b/analyzer.go @@ -49,7 +49,7 @@ func (a *Analyzer) DoError(jerr *JavaError) (matched []SolutionPossibility, err } } if len(e.Message) == 0 { // when ignore error message, error type provide 100% score weight - sol.Match /= 10 / 100 + sol.Match /= 10.0 / 100 } else { jemsg, _ := split(jerr.Message, '\n') matches := lineMatchPercent(jemsg, e.Message) // error message weight: 90% diff --git a/cmd/mcla_wasm/utils.go b/cmd/mcla_wasm/utils.go index f4ae8e7..91f7b27 100644 --- a/cmd/mcla_wasm/utils.go +++ b/cmd/mcla_wasm/utils.go @@ -32,10 +32,12 @@ func asJsValue(v any) (res js.Value) { } buf, err := json.Marshal(v) if err != nil { + fmt.Println("Error in asJsValue: json.Marshal:", err) panic(err) } var v1 any if err = json.Unmarshal(buf, &v1); err != nil { + fmt.Println("Error in asJsValue: json.Unmarshal:", err) panic(err) } return js.ValueOf(v1)