Skip to content

Commit

Permalink
Fix error message
Browse files Browse the repository at this point in the history
Since k6 uses the go Error interface, an actual reason of error hides
without this change.
  • Loading branch information
olegbespalov committed Feb 23, 2024
1 parent ad347ad commit 412c440
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions webcrypto/errors.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package webcrypto

import (
"fmt"
)

// ErrorName is a type alias for the name of a WebCryptoError.
//
// Note that it is a type alias, and not a binding, so that it is
Expand Down Expand Up @@ -53,7 +49,7 @@ type Error struct {

// Error implements the `error` interface, so WebCryptoError are normal Go errors.
func (e *Error) Error() string {
return fmt.Sprintf(e.Name)
return e.Name + ": " + e.Message
}

// NewError returns a new WebCryptoError with the given name and message.
Expand Down

0 comments on commit 412c440

Please sign in to comment.