fix: isolate public subscribe from integration job failures
Queue Weeztix/Mailwizz after the HTTP response and catch dispatch errors. Jobs log Mailwizz/Weeztix API failures without rethrowing so sync driver and terminating callbacks do not surface 500s after a successful create. Add JS fallback for non-JSON error responses, deployment note, and a regression test for failing Mailwizz under QUEUE_CONNECTION=sync. Made-with: Cursor
This commit is contained in:
@@ -555,12 +555,21 @@ document.addEventListener('alpine:init', () => {
|
||||
this.startRedirectCountdownIfNeeded();
|
||||
return;
|
||||
}
|
||||
if (typeof data.message === 'string' && data.message !== '') {
|
||||
const hasServerMessage = typeof data.message === 'string' && data.message !== '';
|
||||
const hasFieldErrors =
|
||||
data.errors !== undefined &&
|
||||
data.errors !== null &&
|
||||
typeof data.errors === 'object' &&
|
||||
Object.keys(data.errors).length > 0;
|
||||
if (hasServerMessage) {
|
||||
this.formError = data.message;
|
||||
}
|
||||
if (data.errors !== undefined && data.errors !== null && typeof data.errors === 'object') {
|
||||
if (hasFieldErrors) {
|
||||
this.fieldErrors = data.errors;
|
||||
}
|
||||
if (!res.ok && !hasServerMessage && !hasFieldErrors) {
|
||||
this.formError = this.genericError;
|
||||
}
|
||||
} catch {
|
||||
this.formError = this.genericError;
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user