Skip to content

Commit

Permalink
fix: incorrect typing
Browse files Browse the repository at this point in the history
  • Loading branch information
rnmeow committed Dec 30, 2024
1 parent 3ed1cec commit 53f045d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/errors/http_error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HTTPException } from 'hono/http-exception'
import type { StatusCode } from 'hono/utils/http-status'
import type { ContentfulStatusCode } from 'hono/utils/http-status'

const httpStatusMap = new Map<
number,
Expand Down Expand Up @@ -65,15 +65,17 @@ const httpStatusMap = new Map<
])

function createRfcHttpError(
code: StatusCode,
code: ContentfulStatusCode,
detail: string,
customHeaders?: Record<string, string>,
): HTTPException {
const match = httpStatusMap.get(code)

const title = match?.title ?? 'UNKNOWN ERROR',
const title = match?.title ?? 'Unknown Error',
rfc6585 = match?.rfc6585 ?? false,
refSection = match?.refSection ?? ''
refSection =
match?.refSection ??
'Please contact the administrator to resolve this issue.'

const payload = {
code,
Expand Down

0 comments on commit 53f045d

Please sign in to comment.