mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
Fix error messages.
This commit is contained in:
parent
30257fd547
commit
243d3e7016
1 changed files with 3 additions and 3 deletions
|
@ -39,11 +39,11 @@ func textDecode(call otto.FunctionCall) otto.Value {
|
||||||
|
|
||||||
arg, err := argv[0].Export()
|
arg, err := argv[0].Export()
|
||||||
if err != nil {
|
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)
|
byteArr, ok := arg.([]uint8)
|
||||||
if !ok {
|
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)
|
decoded := string(byteArr)
|
||||||
|
@ -95,7 +95,7 @@ func atob(call otto.FunctionCall) otto.Value {
|
||||||
|
|
||||||
v, err := otto.ToValue(string(decoded))
|
v, err := otto.ToValue(string(decoded))
|
||||||
if err != nil {
|
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
|
return v
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue