@mikeycoxon/aws-lambda-event-http-router
Version:
AWS Lambda handler utility for HTTP REST request routing based on details in the APIGatewayProxyEvent
19 lines (18 loc) • 494 B
JavaScript
import { StatusCodes } from 'http-status-codes';
import { ApiError } from './ApiError.js';
export class ForbiddenError extends ApiError {
static format(e) {
return {
statusCode: 403,
headers: {
'content-type': 'text/plain'
},
body: e.message,
};
}
constructor(message, statusCode) {
super(message);
this.statusCode = statusCode;
this.statusCode = StatusCodes.FORBIDDEN;
}
}