Task Attachments #104
|
@ -19,14 +19,17 @@ package files
|
|||
|
||||
import "fmt"
|
||||
|
||||
// ErrFileDoesNotExist defines an error where a file does not exist in the db
|
||||
type ErrFileDoesNotExist struct {
|
||||
FileID int64
|
||||
}
|
||||
|
||||
// Error is the error implementaion of ErrFileDoesNotExist
|
||||
func (err ErrFileDoesNotExist) Error() string {
|
||||
return fmt.Sprintf("file %d does not exist", err.FileID)
|
||||
}
|
||||
|
||||
//IsErrFileDoesNotExist checks if an error is ErrFileDoesNotExist
|
||||
func IsErrFileDoesNotExist(err error) bool {
|
||||
_, ok := err.(ErrFileDoesNotExist)
|
||||
return ok
|
||||
|
|
Loading…
Reference in New Issue