fix error handling
This commit is contained in:
parent
6ee96d1b52
commit
d9818d9c87
1 changed files with 3 additions and 2 deletions
|
|
@ -69,11 +69,12 @@ export const actions: Actions = {
|
|||
console.error(`Brevo API error ${response.status}: ${errorText}`);
|
||||
return fail(502, { error: 'Sending failed. Please try again later.', fields });
|
||||
}
|
||||
|
||||
throw redirect(303, '/success');
|
||||
// Success - redirect to thank you page
|
||||
} catch (err) {
|
||||
console.error('Brevo API request failed', err);
|
||||
return fail(500, { error: 'Unexpected error. Please try again later.', fields });
|
||||
}
|
||||
|
||||
throw redirect(303, '/success');
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue