1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 11:27:06 +00:00
Former-commit-id: e83456ced3d00d6da3001d083e22a0568748298e
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-06-09 02:20:28 +03:00
parent 6d977dacd2
commit 46ff69e28e
4 changed files with 20 additions and 22 deletions

View File

@@ -114,7 +114,7 @@ func (t *Transaction) Complete(err error) {
reason = errWstatus.Reason
}
// get the content type used on this transaction
if cTypeH := t.context.ResponseWriter().Header().Get(ContentTypeHeaderKey); cTypeH != "" {
if cTypeH := t.context.GetContentType(); cTypeH != "" {
cType = cTypeH
}
@@ -168,8 +168,7 @@ var RequestTransactionScope = TransactionScopeFunc(func(maybeErr TransactionErrR
ctx.ContentType(maybeErr.ContentType)
} else {
// else execute the registered user error and skip the next transactions and all normal flow,
ctx.StatusCode(maybeErr.StatusCode)
ctx.StopExecution()
ctx.StopWithStatus(maybeErr.StatusCode)
}
})