-
Notifications
You must be signed in to change notification settings - Fork 1
/
errors.go
32 lines (25 loc) · 1.11 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package gofm
import "errors"
var (
// =============== InputFile Manager Errors ===============\\
ErrFmDatabaseClientError = errors.New("file manager database client error") // TODO: should be renamed or adapted
ErrFmDBClientQueryFailed = errors.New("file manager database client query failed") // TODO: should be renamed or adapted
ErrFmFileNotFound = errors.New("file manager file not found")
ErrFmNewFileLocationMissing = errors.New("file manager file location missing")
ErrFmNoInputFile = errors.New("file manager no input file")
ErrFileModelShouldBePointerOfAStruct = errors.New("file manager file model should be pointer of a struct")
// =============== InputFile Manager Errors ===============\\
//
)
// setError -> return the fmError for code simplicity
func (fm *FileManager) setError(fmError, intError error) error {
fm.fmError = fmError
fm.internalError = intError
return fm.fmError
}
func (fm *FileManager) GetInternalError() error {
return fm.internalError
}
func (fm *FileManager) GetError() error {
return fm.fmError
}