File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ export enum ApiErrorDetail {
3535 InvalidRequestLimitNotANumber = 'The limit parameter is not a number' ,
3636 InvalidRequestLimitNotInRange = 'The limit parameter must be a positive number not greater than %s' ,
3737 InvalidRequestLimitOnly = "Only 'limit' query parameter is supported" ,
38- InvalidRequestNoRequestId = 'The request does not contain a request id'
38+ InvalidRequestNoRequestId = 'The request does not contain a request id' ,
39+ InvalidRequestTimestamp = 'Timestamps should be UTC date/times in ISO8601 format, with a Z suffix'
3940}
4041
4142export function buildApiError ( params : {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export const postMi: APIGatewayProxyHandler = async (event) => {
4848
4949 const date = new Date ( timestamp ) ;
5050 if ( Number . isNaN ( date . valueOf ( ) ) || date . toISOString ( ) !== timestamp ) {
51- throw new ValidationError ( '%s is not a valid ISO8601 instant' , { args : [ timestamp ] } ) ;
51+ throw new ValidationError ( ApiErrorDetail . InvalidRequestTimestamp ) ;
5252 }
5353 }
5454} ;
You can’t perform that action at this time.
0 commit comments