Skip to content

Commit 6a1ef8c

Browse files
committed
tweak
1 parent ef269bd commit 6a1ef8c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/plugin-rsc/e2e/basic.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,9 @@ function defineTest(f: Fixture) {
11561156
.click()
11571157
const response = await responsePromise
11581158
expect(response.status()).toBe(500)
1159-
await expect(response.text()).resolves.toBe('Internal Server Error')
1159+
await expect(response.text()).resolves.toBe(
1160+
'Internal Server Error: server action failed',
1161+
)
11601162
})
11611163
})
11621164

packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ export async function handleRequest({
6868
const result = await decodedAction()
6969
formState = await decodeFormState(result, formData)
7070
} catch (e) {
71-
statusCode = 500
71+
// there's no single general obvious way to surface this error,
72+
// so explicitly return classic 500 response.
73+
return new Response('Internal Server Error: server action failed', {
74+
status: 500,
75+
})
7276
}
7377
}
7478
}

0 commit comments

Comments
 (0)