Skip to content

Commit 78e7ed0

Browse files
Correcting flipped ternary statements (#927)
* swap error messages * swap error messages --------- Co-authored-by: Michael Kaiser <[email protected]>
1 parent 53060a7 commit 78e7ed0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

typescript/api-cors-lambda-crud-dynamodb/lambdas/create.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const handler = async (event: any = {}): Promise<any> => {
2626
return { statusCode: 201, body: '' };
2727
} catch (dbError) {
2828
const errorResponse = dbError.code === 'ValidationException' && dbError.message.includes('reserved keyword') ?
29-
DYNAMODB_EXECUTION_ERROR : RESERVED_RESPONSE;
29+
RESERVED_RESPONSE : DYNAMODB_EXECUTION_ERROR;
3030
return { statusCode: 500, body: errorResponse };
3131
}
3232
};

typescript/api-cors-lambda-crud-dynamodb/lambdas/update-one.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const handler = async (event: any = {}): Promise<any> => {
4848
return { statusCode: 204, body: '' };
4949
} catch (dbError) {
5050
const errorResponse = dbError.code === 'ValidationException' && dbError.message.includes('reserved keyword') ?
51-
DYNAMODB_EXECUTION_ERROR : RESERVED_RESPONSE;
51+
RESERVED_RESPONSE : DYNAMODB_EXECUTION_ERROR;
5252
return { statusCode: 500, body: errorResponse };
5353
}
5454
};

0 commit comments

Comments
 (0)