-
Notifications
You must be signed in to change notification settings - Fork 4
/
errors.go
29 lines (22 loc) · 765 Bytes
/
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
package apifaker
import (
"fmt"
)
func JsonFileErrorf(format string, a ...interface{}) error {
return fmt.Errorf("Error [apifaker-JosnFile]: "+format, a...)
}
func ColumnsErrorf(format string, a ...interface{}) error {
return fmt.Errorf("Error [apifaker-columns]: "+format, a...)
}
func HasOneErrorf(format string, a ...interface{}) error {
return fmt.Errorf("Error [apifaker-has_one]: "+format, a...)
}
func HasManyErrorf(format string, a ...interface{}) error {
return fmt.Errorf("Error [apifaker-has_many]: "+format, a...)
}
func SeedsErrorf(format string, a ...interface{}) error {
return fmt.Errorf("Error [apifaker-seeds]: "+format, a...)
}
func ResponseErrorMsg(err error) map[string]string {
return map[string]string{"message": err.Error()}
}