Skip to content

Commit d4c3a3b

Browse files
fix: Bad replacements
1 parent 6c43eaf commit d4c3a3b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/kit/src/runtime/server/page/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function validate_action_return(data) {
235235
}
236236

237237
if (data instanceof HttpError) {
238-
throw new Error('Cannot `return error(...)` — use `error...)` or `return fail(...)` instead');
238+
throw new Error('Cannot `return error(...)` — use `error(...)` or `return fail(...)` instead');
239239
}
240240
}
241241

packages/kit/test/apps/basics/src/routes/errors/+layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { error } from '@sveltejs/kit';
44
export async function load({ fetch, url }) {
55
if (url.pathname.startsWith('/errors/error-in-layout')) {
66
const res = await fetch('/errors/error-in-layout/non-existent');
7-
errorres.status);
7+
error(res.status);
88
}
99
}

packages/kit/test/apps/basics/test/server.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ test.describe('Errors', () => {
300300
);
301301
});
302302

303-
test('error...) in endpoint', async ({ request, read_errors }) => {
303+
test('error(...) in endpoint', async ({ request, read_errors }) => {
304304
// HTML
305305
{
306306
const res = await request.get('/errors/endpoint-throw-error', {

0 commit comments

Comments
 (0)