mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -05:00
Handled subscription deletion errors with logging
refs https://github.com/TryGhost/Ghost/issues/11557 If a subscription failed to delete, we would error and bailout of the process, this updates it to log the error so that site owners have a record of the error in the logs, but also to continue through the rest of the subscriptions.
This commit is contained in:
parent
b435d6a8c1
commit
d63484e99a
1 changed files with 7 additions and 2 deletions
|
@ -266,8 +266,13 @@ module.exports = class StripePaymentProcessor {
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const subscription of activeSubscriptions) {
|
for (const subscription of activeSubscriptions) {
|
||||||
const updatedSubscription = await del(this._stripe, 'subscriptions', subscription.id);
|
try {
|
||||||
await this._updateSubscription(updatedSubscription);
|
const updatedSubscription = await del(this._stripe, 'subscriptions', subscription.id);
|
||||||
|
await this._updateSubscription(updatedSubscription);
|
||||||
|
} catch (err) {
|
||||||
|
this.logging.error(`There was an error cancelling subscription ${subscription.id}`);
|
||||||
|
this.logging.error(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue