(ctx iris.Context)
| 73 | } |
| 74 | |
| 75 | func GetCustomStructWithError(ctx iris.Context) (s testCustomStruct, err error) { |
| 76 | s = testCustomStruct{"Iris", 2} |
| 77 | if ctx.URLParamExists("err") { |
| 78 | err = errors.New("omit return of testCustomStruct and fire error") |
| 79 | } |
| 80 | |
| 81 | // it should send the testCustomStruct as JSON if error is nil |
| 82 | // otherwise it should fire the default error(BadRequest) with the error's text. |
| 83 | return |
| 84 | } |
| 85 | |
| 86 | type err struct { |
| 87 | Status int `json:"status_code"` |
nothing calls this directly
no test coverage detected
searching dependent graphs…