(title string, message ...string)
| 19 | } |
| 20 | |
| 21 | func ErrorMessage(title string, message ...string) error { |
| 22 | jsonMessage, _ := json.Marshal(message) |
| 23 | row := &gin.H{ |
| 24 | "title": title, |
| 25 | "message": string(jsonMessage), |
| 26 | "type": "error", |
| 27 | "createdAt": time.Now().Local(), |
| 28 | } |
| 29 | result, _ := json.Marshal(row) |
| 30 | return errors.New(string(result)) |
| 31 | } |
no outgoing calls
no test coverage detected