mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Moved exception handling for members migrations
refs https://github.com/TryGhost/Toolbox/issues/358 - Error handling should be done as close to the place that knows how to handle them. It's a catch-all block which doesn't add any logic, so does not really make sense to have that extra code in general "init" method which ideally should be just a whole bunch of calls with no extras.
This commit is contained in:
parent
679634342a
commit
8c3473e5e0
2 changed files with 15 additions and 15 deletions
|
@ -148,11 +148,7 @@ module.exports = {
|
|||
}
|
||||
})();
|
||||
|
||||
try {
|
||||
await stripeService.migrations.execute();
|
||||
} catch (err) {
|
||||
logging.error(err);
|
||||
}
|
||||
await stripeService.migrations.execute();
|
||||
},
|
||||
contentGating: require('./content-gating'),
|
||||
|
||||
|
|
|
@ -27,16 +27,20 @@ module.exports = class StripeMigrations {
|
|||
return;
|
||||
}
|
||||
|
||||
await this.populateProductsAndPrices();
|
||||
await this.populateStripePricesFromStripePlansSetting();
|
||||
await this.populateMembersMonthlyPriceIdSettings();
|
||||
await this.populateMembersYearlyPriceIdSettings();
|
||||
await this.populateDefaultProductMonthlyPriceId();
|
||||
await this.populateDefaultProductYearlyPriceId();
|
||||
await this.revertPortalPlansSetting();
|
||||
await this.removeInvalidSubscriptions();
|
||||
await this.setDefaultProductName();
|
||||
await this.updateStripeProductNamesFromDefaultProduct();
|
||||
try {
|
||||
await this.populateProductsAndPrices();
|
||||
await this.populateStripePricesFromStripePlansSetting();
|
||||
await this.populateMembersMonthlyPriceIdSettings();
|
||||
await this.populateMembersYearlyPriceIdSettings();
|
||||
await this.populateDefaultProductMonthlyPriceId();
|
||||
await this.populateDefaultProductYearlyPriceId();
|
||||
await this.revertPortalPlansSetting();
|
||||
await this.removeInvalidSubscriptions();
|
||||
await this.setDefaultProductName();
|
||||
await this.updateStripeProductNamesFromDefaultProduct();
|
||||
} catch (err) {
|
||||
logging.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
async populateProductsAndPrices(options) {
|
||||
|
|
Loading…
Add table
Reference in a new issue