@emartech/program-executor
Advanced tools
| 'use strict'; | ||
| class IgnorableError extends Error { | ||
| constructor(message, code) { | ||
| super(); | ||
| this.message = message; | ||
| this.code = code; | ||
| this.response = { status: code }; | ||
| IgnorableError.decorate(this); | ||
| } | ||
| static decorate(error) { | ||
| error.ignorable = true; | ||
| return error; | ||
| } | ||
| static isIgnorable(error) { | ||
| return !!error.ignorable; | ||
| } | ||
| } | ||
| module.exports = IgnorableError; |
| 'use strict'; | ||
| const IgnorableError = require('./'); | ||
| describe('IgnorableError', () => { | ||
| it('should have a retryable property set to true', () => { | ||
| try { | ||
| throw new IgnorableError(); | ||
| } catch (error) { | ||
| expect(error.ignorable).to.be.true; | ||
| } | ||
| }); | ||
| it('should have a message and a code', () => { | ||
| try { | ||
| throw new IgnorableError('Something bad happened!', 200); | ||
| } catch (error) { | ||
| expect(error.message).to.eql('Something bad happened!'); | ||
| expect(error.code).to.eql(200); | ||
| } | ||
| }); | ||
| it('should have an isIgnorable method', () => { | ||
| try { | ||
| throw new IgnorableError('Something bad happened!'); | ||
| } catch (error) { | ||
| expect(IgnorableError.isIgnorable(error)).to.eql(true); | ||
| } | ||
| }); | ||
| }); |
+1
-1
@@ -45,3 +45,3 @@ { | ||
| }, | ||
| "version": "1.3.0" | ||
| "version": "1.4.0" | ||
| } |
+11
-11
| /** | ||
| * @param {object} config | ||
| * @param {object} object.knex - Connected Knex instance | ||
| * @param {string} object.amqpUrl - RabbitMq Url | ||
| * @param {string} object.tableName - Table name for bookkeeping | ||
| * @param {string} object.queueName - Queue name to publish to | ||
| * @param {object} config.knex - Connected Knex instance | ||
| * @param {string} config.amqpUrl - RabbitMq Url | ||
| * @param {string} config.tableName - Table name for bookkeeping | ||
| * @param {string} config.queueName - Queue name to publish to | ||
| */ | ||
@@ -12,5 +12,5 @@ declare class ProgramExecutor { | ||
| * @param {object} data | ||
| * @param {object} object.programData | ||
| * @param {array} object.jobs | ||
| * @param {object} object.jobsData | ||
| * @param {object} data.programData | ||
| * @param {array} data.jobs | ||
| * @param {object} data.jobsData | ||
| */ | ||
@@ -20,6 +20,6 @@ createProgram(data: any): void; | ||
| * @param {object} config | ||
| * @param {object} object.knex - Connected Knex instance | ||
| * @param {string} object.amqpUrl - RabbitMq Url | ||
| * @param {string} object.tableName - Table name for bookkeeping | ||
| * @param {string} object.queueName - Queue name to publish to | ||
| * @param {object} config.knex - Connected Knex instance | ||
| * @param {string} config.amqpUrl - RabbitMq Url | ||
| * @param {string} config.tableName - Table name for bookkeeping | ||
| * @param {string} config.queueName - Queue name to publish to | ||
| */ | ||
@@ -26,0 +26,0 @@ static create(config: any): void; |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
48061
2.44%30
7.14%1138
4.02%