github.com/abolfazlbeh/zhycan@v0.0.0-20230819144214-24cf38237387/internal/watcher/error.go (about) 1 package watcher 2 3 import "fmt" 4 5 // StartWatcherErr Error 6 type StartWatcherErr struct { 7 Err error 8 } 9 10 // Error method - satisfying error interface 11 func (err *StartWatcherErr) Error() string { 12 return fmt.Sprintf("Cannot start watcher instance | %v", err.Err) 13 } 14 15 // NewStartWatcherErr - return a new instance of StartWatcherErr 16 func NewStartWatcherErr(err error) error { 17 return &StartWatcherErr{Err: err} 18 }