Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@emartech/program-executor

Package Overview
Dependencies
Maintainers
95
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emartech/program-executor - npm Package Compare versions

Comparing version
1.3.0
to
1.4.0
+22
src/ignorable-error/index.js
'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"
}
/**
* @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;