Files
graylog-project-cli/logger/loggable_error.go
Bernd Ahlers 385ec22572 Print all errors at the end of update command
This makes it easier to spot any errors when updating the project
repositories by displaying them at the end of the command.
2023-08-08 17:47:05 +02:00

26 lines
428 B
Go

package logger
import "fmt"
func NewLoggableError(err error, title string, messages []string) *LoggableError {
return &LoggableError{
title: title,
Messages: messages,
err: err,
}
}
type LoggableError struct {
title string
Messages []string
err error
}
func (l LoggableError) Cause() error {
return l.err
}
func (l LoggableError) Error() string {
return fmt.Sprintf("%s: %s", l.title, l.err)
}