Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package errs |
||
2 | |||
3 | import ( |
||
4 | "fmt" |
||
5 | ) |
||
6 | |||
7 | func NewUnsupportedTypeError(kind string) error { |
||
8 | return fmt.Errorf("the given parameter(%s) is unsupported type ", kind) |
||
9 | } |
||
10 | |||
11 | func NilReferenceTypeError() error { |
||
12 | return fmt.Errorf("the given parameter is nil ") |
||
13 | } |
||
14 | |||
15 | func EmptyStringError() error { |
||
16 | return fmt.Errorf("the given string is empty") |
||
17 | } |
||
18 | |||
19 | func Int64Error(kind string) error { |
||
20 | return fmt.Errorf("the entered value cannot convert from %s to int64", kind) |
||
21 | } |
||
22 | |||
23 | func Int32Error(kind string) error { |
||
24 | return fmt.Errorf("the entered value cannot convert from %s to int32", kind) |
||
25 | } |
||
26 | |||
27 | func Int16Error(kind string) error { |
||
28 | return fmt.Errorf("the entered value cannot convert from %s to int16", kind) |
||
29 | } |
||
30 | |||
31 | func CustomError(message string) error { |
||
32 | return fmt.Errorf(message) |
||
33 | } |
||
34 | |||
35 | func NewUnsupportedParameterTypeError(kind string, desc string) error { |
||
36 | return fmt.Errorf("the given parameter/s(%s) is unsupported type. %s", kind, desc) |
||
37 | } |
||
38 | |||
39 | func NewMissingParameterError(kind string, desc string) error { |
||
40 | return fmt.Errorf("the given parameter/s(%s) is missing. %s", kind, desc) |
||
41 | } |
||
42 |