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,4 +1,5 @@
const Util = require('../util/Util');
const { Error } = require('../errors');
/**
* Helper class for sharded clients spawned as a child process, such as from a ShardingManager.
@@ -40,7 +41,7 @@ class ShardClientUtil {
const sent = process.send(message, err => {
if (err) reject(err); else resolve();
});
if (!sent) throw new Error('Failed to send message to master process.');
if (!sent) throw new Error('SHARDING_PARENT_CONNECTION');
});
}