Skip to content

Commit 8a1e983

Browse files
committed
refactor: keep httpException handler and it's typings in sync
1 parent 182f6db commit 8a1e983

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

adonis-typings/exception-handler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ declare module '@ioc:Adonis/Core/HttpExceptionHandler' {
1818
export default abstract class HttpExceptionHandler {
1919
constructor (logger: LoggerContract)
2020
protected logger: LoggerContract
21-
protected dontReport: string[]
21+
protected ignoreCodes: string[]
2222
protected ignoreStatuses: number[]
23-
protected internalDontReport: string[]
23+
protected internalIgnoreCodes: string[]
2424
protected statusPages: { [key: string]: string }
2525
public expandedStatusPages: { [key: string]: string }
2626
protected disableStatusPagesInDevelopment: boolean
2727
protected context (ctx: HttpContextContract): any
2828
protected shouldReport (error: any): boolean
2929
protected makeJSONResponse (error: any, ctx: HttpContextContract): Promise<void>
30+
protected makeJSONAPIResponse (error: any, ctx: HttpContextContract): Promise<void>
3031
protected makeHtmlResponse (error: any, ctx: HttpContextContract): Promise<void>
3132
public report (error: any, ctx: HttpContextContract): void
3233
public handle (error: any, ctx: HttpContextContract): Promise<any>

test/exception-handler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const encryption = new Encryption('verylongandrandom32characterskey')
2727
test.group('HttpExceptionHandler', () => {
2828
test('do not report error if error code is in ignore list', (assert) => {
2929
class AppHandler extends HttpExceptionHandler {
30-
protected dontReport = ['E_BAD_REQUEST']
30+
protected ignoreCodes = ['E_BAD_REQUEST']
3131
}
3232

3333
const logger = new FakeLogger(loggerConfig)

0 commit comments

Comments
 (0)