File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ <h5 class="card-title">
5555 < div class ="card ">
5656 < div class ="card-body ">
5757 < h5 class ="card-title ">
58- August 27th 2020, 3:46:36 pm
58+ August 27th 2020, 3:51:23 pm
5959 </ h5 >
6060 < p class ="card-text "> Last updated</ p >
6161 </ div >
Original file line number Diff line number Diff line change 1010/// <reference path="../../adonis-typings/index.ts" />
1111
1212import { Exception , interpolate } from '@poppinss/utils'
13- import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
1413
1514import { E_HTTP_EXCEPTION } from '../../exceptions.json'
1615
@@ -37,12 +36,4 @@ export class HttpException extends Exception {
3736 error . body = error . message
3837 return error
3938 }
40-
41- /**
42- * Handle itself by making the response. This only works when using the
43- * base exception handler shipped by AdonisJs
44- */
45- public handle ( error : HttpException , ctx : HttpContextContract ) {
46- ctx . response . status ( error . status ) . send ( error . body )
47- }
4839}
Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ import { CookieSerializer } from '../Cookie/Serializer'
4141import { HttpException } from '../Exceptions/HttpException'
4242import { E_CANNOT_SERIALIZE_RESPONSE_BODY } from '../../exceptions.json'
4343
44+ class AbortException extends HttpException {
45+ /**
46+ * Handle itself by making the response. This only works when using the
47+ * base exception handler shipped by AdonisJs
48+ */
49+ public handle ( error : HttpException , ctx : HttpContextContract ) {
50+ ctx . response . status ( error . status ) . send ( error . body )
51+ }
52+ }
53+
4454/**
4555 * The response is a wrapper over [ServerResponse](https://nodejs.org/api/http.html#http_class_http_serverresponse)
4656 * streamlining the process of writing response body and automatically setting up appropriate headers.
@@ -809,7 +819,7 @@ export class Response extends Macroable implements ResponseContract {
809819 * used when status is not defined
810820 */
811821 public abort ( body : any , status ?: number ) : never {
812- throw HttpException . invoke ( body , status || 400 )
822+ throw AbortException . invoke ( body , status || 400 )
813823 }
814824
815825 /**
You can’t perform that action at this time.
0 commit comments