Errors Standardization (#1246)

* errors and stuff

* more errors

* all the errors

* fix build
This commit is contained in:
Gus Caplan
2017-06-25 12:48:05 -05:00
committed by Amish Shah
parent 602fe06f88
commit 63e54982f4
28 changed files with 258 additions and 102 deletions

View File

@@ -1,6 +1,7 @@
const childProcess = require('child_process');
const path = require('path');
const Util = require('../util/Util');
const { Error } = require('../errors');
/**
* Represents a Shard spawned by the ShardingManager.
@@ -60,7 +61,7 @@ class Shard {
const sent = this.process.send(message, err => {
if (err) reject(err); else resolve(this);
});
if (!sent) throw new Error('Failed to send message to shard\'s process.');
if (!sent) throw new Error('SHARDING_CHILD_CONNECTION');
});
}