mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -05:00
Removed use of deprecated new Error() syntax
refs2f1123d6ca
refs6f1a3e1774
- As per refed commits, we are removing deprecated use of `new Error()` in the codebase
This commit is contained in:
parent
a266c64130
commit
4c4af001e6
1 changed files with 11 additions and 1 deletions
|
@ -2,6 +2,12 @@ const {chunk} = require('lodash');
|
|||
const ObjectID = require('bson-objectid');
|
||||
const {createTransactionalMigration} = require('../../utils');
|
||||
const logging = require('@tryghost/logging');
|
||||
const errors = require('@tryghost/errors');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
|
||||
const messages = {
|
||||
unknownSubscriptionIntervalError: 'Unknown Subscription interval "{interval}" found.'
|
||||
};
|
||||
|
||||
module.exports = createTransactionalMigration(
|
||||
async function up(knex) {
|
||||
|
@ -38,7 +44,11 @@ module.exports = createTransactionalMigration(
|
|||
return amount * 30;
|
||||
}
|
||||
|
||||
throw new Error(`Unknown Subscription interval "${interval}" found.`);
|
||||
throw new errors.GhostError({
|
||||
message: tpl(messages.unknownSubscriptionIntervalError , {
|
||||
interval
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
const allEvents = allSubscriptions.reduce((allEventsAcc, subscription) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue