From 243d3e701618026e7738fb0e58ed28c4a5186795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=B8=EF=B8=8F?= <29265684+buffermet@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:33:04 +0100 Subject: [PATCH] Fix error messages. --- js/data.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/data.go b/js/data.go index 346a0aa4..ad62f3a8 100644 --- a/js/data.go +++ b/js/data.go @@ -39,11 +39,11 @@ func textDecode(call otto.FunctionCall) otto.Value { arg, err := argv[0].Export() if err != nil { - return ReportError("textDecode: could not export argument value:", err.Error()) + return ReportError("textDecode: could not export argument value: %s", err.Error()) } byteArr, ok := arg.([]uint8) if !ok { - return ReportError("textDecode: single argument must be of type []uint8.", argc) + return ReportError("textDecode: single argument must be of type []uint8.") } decoded := string(byteArr) @@ -95,7 +95,7 @@ func atob(call otto.FunctionCall) otto.Value { v, err := otto.ToValue(string(decoded)) if err != nil { - return ReportError("atob: could not convert to string: %s", decoded) + return ReportError("atob: could not convert to string: %s", err.Error()) } return v