Skip to content

Commit

Permalink
Create worker error for worker files.
Browse files Browse the repository at this point in the history
  • Loading branch information
rottmann committed Nov 12, 2014
1 parent b01f7ca commit 2d8b6f4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/errors/worker_error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var util = require('util');

function WorkerError(message, file, block, element, extra) {
// enable stack trace
Error.call(this);
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;

this.message = message;
this.file = file;
this.block = block;
this.element = element;
this.extra = extra;
}

/**
* Inherit from Error
*/
util.inherits(WorkerError, Error);

/**
* Exports
*/
module.exports = WorkerError;

0 comments on commit 2d8b6f4

Please sign in to comment.