1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 03:47:04 +00:00

replace all common error responses with the new Context.StopWithError

Former-commit-id: 99b08a0b5564ef640456db12674cb37721f73ae3
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-05-18 00:25:38 +03:00
parent 07cd03a674
commit f3745cebbd
14 changed files with 21 additions and 32 deletions

View File

@@ -17,8 +17,8 @@ func main() {
var t MyType
err := ctx.ReadQuery(&t)
if err != nil && !iris.IsErrPath(err) {
ctx.StatusCode(iris.StatusInternalServerError)
ctx.WriteString(err.Error())
ctx.StopWithError(iris.StatusInternalServerError, err)
return
}
ctx.Writef("MyType: %#v", t)