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 587b7cd commit 343ae92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to AWS EC2
on:
push:
branches:
- develop
- feature/screenshot-test
release:
types: [published]

Expand Down
8 changes: 6 additions & 2 deletions src/app/board/api/screenshot/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ export async function POST(request: Request) {
},
})
} catch (error) {
console.log(error)
await browser.close()
return new NextResponse('Error taking screenshot', { status: 500 })
return new NextResponse(
`Error taking screenshot: ${error?.message || error}`,
{
status: 500,
},
)
}
}

0 comments on commit 343ae92

Please sign in to comment.