Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package goagi |
||
2 | |||
3 | import "fmt" |
||
4 | |||
5 | type Error struct { |
||
|
|||
6 | s string |
||
7 | e string |
||
8 | } |
||
9 | |||
10 | func newError(ctx string) *Error { |
||
11 | return &Error{s: ctx} |
||
12 | } |
||
13 | |||
14 | func (e *Error) Msg(msg string, args ...interface{}) error { |
||
15 | e.e = fmt.Sprintf(msg, args...) |
||
16 | return e |
||
17 | } |
||
18 | |||
19 | func (e *Error) Error() string { |
||
20 | return fmt.Sprintf("%s: %s", e.s, e.e) |
||
21 | } |
||
22 |