Wrap is a helper function to wrap an Error with given code.
(err error, code Code)
| 110 | |
| 111 | // Wrap is a helper function to wrap an Error with given code. |
| 112 | func Wrap(err error, code Code) *Error { |
| 113 | return &Error{ |
| 114 | Code: code, |
| 115 | Err: err, |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | // FormatDBErrorEmptyRowWithQuery formats database error that query returns empty row. |
| 120 | func FormatDBErrorEmptyRowWithQuery(query string) error { |