Skip to content

Commit

Permalink
refactor: keep httpException handler and it's typings in sync
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Mar 1, 2020
1 parent 182f6db commit 8a1e983
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions adonis-typings/exception-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ declare module '@ioc:Adonis/Core/HttpExceptionHandler' {
export default abstract class HttpExceptionHandler {
constructor (logger: LoggerContract)
protected logger: LoggerContract
protected dontReport: string[]
protected ignoreCodes: string[]
protected ignoreStatuses: number[]
protected internalDontReport: string[]
protected internalIgnoreCodes: string[]
protected statusPages: { [key: string]: string }
public expandedStatusPages: { [key: string]: string }
protected disableStatusPagesInDevelopment: boolean
protected context (ctx: HttpContextContract): any
protected shouldReport (error: any): boolean
protected makeJSONResponse (error: any, ctx: HttpContextContract): Promise<void>
protected makeJSONAPIResponse (error: any, ctx: HttpContextContract): Promise<void>
protected makeHtmlResponse (error: any, ctx: HttpContextContract): Promise<void>
public report (error: any, ctx: HttpContextContract): void
public handle (error: any, ctx: HttpContextContract): Promise<any>
Expand Down
2 changes: 1 addition & 1 deletion test/exception-handler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const encryption = new Encryption('verylongandrandom32characterskey')
test.group('HttpExceptionHandler', () => {
test('do not report error if error code is in ignore list', (assert) => {
class AppHandler extends HttpExceptionHandler {
protected dontReport = ['E_BAD_REQUEST']
protected ignoreCodes = ['E_BAD_REQUEST']
}

const logger = new FakeLogger(loggerConfig)
Expand Down

0 comments on commit 8a1e983

Please sign in to comment.