Skip to content

Commit 99b4cd4

Browse files
committed
Change E_TIMEOUT error code to E_MACHINE_TIMEOUT for consistency with E_MACHINE_RUNTIME_VALIDATION (and to keep error codes contained within our namespace).
1 parent 140bb62 commit 99b4cd4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/Machine.prototype.exec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ module.exports = function Machine_prototype_exec (done) {
704704
'If you are the implementor of this machine, and you\'re sure there are no problems, you can configure '+
705705
'the maximum expected number of miliseconds for this machine using `timeout` (a top-level property in '+
706706
'your machine definition). To disable this protection, set `timeout` to 0.');
707-
err.code = 'E_TIMEOUT';
707+
err.code = 'E_MACHINE_TIMEOUT';
708708

709709
// Trigger callback
710710
implementorSwitchback.error(err);

test/timeout.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ describe('timeout', function (){
2323
it('should call its error exit with a timeout error', function (done){
2424
machineInstance().exec({
2525
error: function (err) {
26-
if (err.code === 'E_TIMEOUT') {
26+
if (err.code === 'E_MACHINE_TIMEOUT') {
2727
return done();
2828
}
29-
return done(new Error('Expecting Error instance w/ `code` === "E_TIMEOUT", but instead got this error (code:'+err.code+'): '+err.stack));
29+
return done(new Error('Expecting Error instance w/ `code` === "E_MACHINE_TIMEOUT", but instead got this error (code:'+err.code+'): '+err.stack));
3030
},
3131
success: function (){
3232
return done(new Error('wtf'));
@@ -54,10 +54,10 @@ describe('timeout', function (){
5454
it('should call its error exit with a timeout error', function (done){
5555
machineInstance().exec({
5656
error: function (err) {
57-
if (err.code === 'E_TIMEOUT') {
57+
if (err.code === 'E_MACHINE_TIMEOUT') {
5858
return done();
5959
}
60-
return done(new Error('Expecting Error instance w/ `code` === "E_TIMEOUT", but instead got this error (code:'+err.code+'): '+err.stack));
60+
return done(new Error('Expecting Error instance w/ `code` === "E_MACHINE_TIMEOUT", but instead got this error (code:'+err.code+'): '+err.stack));
6161
},
6262
success: function (){
6363
return done(new Error('Should not have called the success exit (should have been prevented by timeout alarm)'));

0 commit comments

Comments
 (0)