-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ac008e
commit 255a3bf
Showing
3 changed files
with
12 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
import { ApiError, makeApiProblemBuilder } from "pagopa-interop-models"; | ||
import { makeApiProblemBuilder } from "pagopa-interop-models"; | ||
|
||
export const errorCodes = { | ||
clientNotFound: "0001", | ||
missingUserId: "0002", | ||
}; | ||
|
||
export function missingUserId(kid: string): ApiError<ErrorCodes> { | ||
return new ApiError({ | ||
detail: `Key ${kid} has not UserId`, | ||
code: "missingUserId", | ||
title: "Missing userId", | ||
}); | ||
} | ||
|
||
export type ErrorCodes = keyof typeof errorCodes; | ||
|
||
export const makeApiProblem = makeApiProblemBuilder(errorCodes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters