Skip to content

Commit

Permalink
feat: add errorMessage to screenshot api
Browse files Browse the repository at this point in the history
  • Loading branch information
junseublim committed Dec 18, 2024
1 parent 343ae92 commit 1e7d860
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/board/api/screenshot/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ export async function POST(request: Request) {
})
} catch (error) {
await browser.close()
return new NextResponse(
`Error taking screenshot: ${error?.message || error}`,
{
status: 500,
},
)
const errorObj = error as Error

return new NextResponse(`Error taking screenshot: ${errorObj.message}`, {
status: 500,
})
}
}

0 comments on commit 1e7d860

Please sign in to comment.