mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
Merge pull request #1651 from Enliven-se/vulcan-newsletter-mailchimp-error-handling
use correct code for Mailchimp "already subscribed" state
This commit is contained in:
commit
5f95749f17
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ if (settings) {
|
|||
return {result: 'subscribed', ...subscribe};
|
||||
} catch (error) {
|
||||
// if the email is already in the Mailchimp list, no need to throw an error
|
||||
if (error.message === "214") {
|
||||
if (error.code === 214) {
|
||||
return {result: 'already-subscribed'};
|
||||
}
|
||||
throw new Error("subscription-failed", error.message);
|
||||
|
@ -118,4 +118,4 @@ if (settings) {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue