Skip to content
Snippets Groups Projects

Error msg to support formatting

Merged Christel Loftus requested to merge error_msg_to_support_formatting into main
1 file
+ 6
2
Compare changes
  • Side-by-side
  • Inline
+ 6
2
@@ -242,11 +242,13 @@ func ErrorWithFields(fields map[string]interface{}, err error) {
}
}
func ErrorWithMsg(message string, err error) {
func ErrorWithMsg(format string, err error, a ...interface{}) {
if disableLogging {
return
}
message := SanitiseLogs(fmt.Sprintf(format, a...))
if err == nil {
err = errors.Error(message)
}
@@ -255,11 +257,13 @@ func ErrorWithMsg(message string, err error) {
}, err)
}
func ErrorMsg(message string) {
func ErrorMsg(format string, a ...interface{}) {
if disableLogging {
return
}
message := SanitiseLogs(fmt.Sprintf(format, a...))
ErrorWithMsg(message, nil)
}
Loading