commands: make FullError
print the first line of debugged or fatal errors
This commit is contained in:
parent
a06accadc8
commit
1dabeb5950
@ -85,7 +85,7 @@ func FullError(err error) {
|
||||
|
||||
func errorWith(err error, fatalErrFn func(error, string, ...interface{}), errFn func(string, ...interface{})) {
|
||||
if Debugging || errors.IsFatalError(err) {
|
||||
fatalErrFn(err, "")
|
||||
fatalErrFn(err, "%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -101,8 +101,9 @@ func Debug(format string, args ...interface{}) {
|
||||
log.Printf(format, args...)
|
||||
}
|
||||
|
||||
// LoggedError prints a formatted message to Stderr and writes a stack trace for
|
||||
// the error to a log file without exiting.
|
||||
// LoggedError prints the given message formatted with its arguments (if any) to
|
||||
// Stderr. It also writes a stack trace for the error to a log file without
|
||||
// exiting.
|
||||
func LoggedError(err error, format string, args ...interface{}) {
|
||||
if len(format) > 0 {
|
||||
Error(format, args...)
|
||||
|
Loading…
Reference in New Issue
Block a user