summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-09-12 08:55:30 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-09-12 08:55:30 +0200
commit2d152ba32d048e1e97438d99dd24ed5a32a6b961 (patch)
treefb0aedfde1cf57de7a9e2b36622f62657040faf1 /internal
parent4a25897ab3e048b8b59c25d50f7f314d21847f2e (diff)
Types Error: Do not panic on JSON error
Diffstat (limited to 'internal')
-rw-r--r--internal/types/error.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/types/error.go b/internal/types/error.go
index ad6a7e0..8612de3 100644
--- a/internal/types/error.go
+++ b/internal/types/error.go
@@ -88,7 +88,7 @@ type WrappedErrorMessageJSON struct {
Traceback string `json:"traceback"`
}
-func GetErrorJSONString(err error) string {
+func GetErrorJSONString(err error) (string, error) {
var wrappedErr *WrappedErrorMessage
var level ErrorLevel
@@ -110,7 +110,7 @@ func GetErrorJSONString(err error) string {
)
if jsonErr != nil {
- panic(jsonErr)
+ return "", jsonErr
}
- return string(json)
+ return string(json), nil
}