Skip to content

Commit 6ca398d

Browse files
committed
Refactor error type declaration
1 parent a1f691c commit 6ca398d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

myhaki/src/app/api/users/[id]/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export async function GET(request: NextRequest) {
2323
status: response.status,
2424
headers: { 'Content-Type': 'application/json' },
2525
});
26-
} catch (error: any) {
27-
return new Response(JSON.stringify({ error: error.message }), {
26+
} catch (error) {
27+
return new Response(JSON.stringify({ error: (error as Error).message }), {
2828
status: 500,
29-
headers: { 'Content-Type': 'application/json' },
29+
headers: { 'Content-Type': 'application/json' }
3030
});
3131
}
3232
}

0 commit comments

Comments
 (0)