mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-18 05:09:29 +00:00
add auth docs, add eslint import/order
This commit is contained in:
@@ -8,11 +8,13 @@ export class HttpExceptionFilter implements ExceptionFilter {
|
||||
const response = ctx.getResponse<Response>()
|
||||
const request = ctx.getRequest<Request>()
|
||||
const status = exception.getStatus()
|
||||
|
||||
if (status === 400) {
|
||||
const errorsResponse = {
|
||||
errorMessages: [],
|
||||
}
|
||||
const responseBody: any = exception.getResponse()
|
||||
|
||||
if (typeof responseBody.message === 'object') {
|
||||
responseBody.message.forEach(e => errorsResponse.errorMessages.push(e))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user