Skip to content

Commit ded48aa

Browse files
WIP Remove id from Error?
1 parent 3ffc1ce commit ded48aa

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

lambdas/api-handler/src/contracts/errors.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { randomUUID } from 'crypto';
22

33
export interface ApiError {
4-
id: string;
54
code: ApiErrorCode;
65
links: {about: 'https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier'};
76
status: ApiErrorStatus;
@@ -46,7 +45,6 @@ export function buildApiError(params: {
4645
detail: ApiErrorDetail | string;
4746
}): ApiError {
4847
return {
49-
id: randomUUID(), // TODO CCM-11188: correlation ID?
5048
code: params.code,
5149
links: { about: 'https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier' },
5250
status: params.status,

lambdas/api-handler/src/mappers/__tests__/error-mapper.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ describe("mapErrorToResponse", () => {
1414
{
1515
"code": "NOTIFY_INVALID_REQUEST",
1616
"detail": "The letter ID in the request body does not match the letter ID path parameter",
17-
"id": expect.any(String),
1817
"links": {
1918
"about": "https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier"
2019
},
@@ -36,7 +35,6 @@ describe("mapErrorToResponse", () => {
3635
{
3736
"code": "NOTIFY_LETTER_NOT_FOUND",
3837
"detail": "The provided letter ID does not exist for the supplier",
39-
"id": expect.any(String),
4038
"links": {
4139
"about": "https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier"
4240
},
@@ -58,7 +56,6 @@ describe("mapErrorToResponse", () => {
5856
{
5957
"code": "NOTIFY_INTERNAL_SERVER_ERROR",
6058
"detail": "Something broke",
61-
"id": expect.any(String),
6259
"links": {
6360
"about": "https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier"
6461
},
@@ -80,7 +77,6 @@ describe("mapErrorToResponse", () => {
8077
{
8178
"code": "NOTIFY_INTERNAL_SERVER_ERROR",
8279
"detail": "Unexpected error",
83-
"id": expect.any(String),
8480
"links": {
8581
"about": "https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier"
8682
},

0 commit comments

Comments
 (0)