Skip to content

Commit 6ad6ce9

Browse files
committed
use different serialization
1 parent 943af7a commit 6ad6ce9

File tree

1 file changed

+5
-1
lines changed
  • packages/render/integrations/nextjs/app/api

1 file changed

+5
-1
lines changed

packages/render/integrations/nextjs/app/api/route.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ export async function GET() {
55
const html = await render(<div>testing element</div>, { pretty: true });
66
return new Response(html);
77
} catch (exception) {
8-
return new Response(JSON.stringify(exception), {
8+
let message = 'Some error ocurred';
9+
if (exception instanceof Error) {
10+
message = exception.toString();
11+
}
12+
return new Response(message, {
913
status: 500,
1014
});
1115
}

0 commit comments

Comments
 (0)