modify error model

This commit is contained in:
Maidul Islam
2022-12-06 14:55:54 -05:00
parent 8cd9e20fa6
commit 3db1ff2411

View File

@@ -5,10 +5,13 @@ import log "github.com/sirupsen/logrus"
// Custom error type so that we can give helpful messages in CLI // Custom error type so that we can give helpful messages in CLI
type Error struct { type Error struct {
Err error Err error
DebugMessage string
FriendlyMessage string FriendlyMessage string
} }
func (e *Error) printFriendlyMessage() { func (e *Error) printFriendlyMessage() {
log.Infoln(e.FriendlyMessage) log.Infoln(e.FriendlyMessage)
} }
func (e *Error) printDebuError() {
log.Debugln(e.Err)
}