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,6 @@
const querystring = require('querystring');
const snekfetch = require('snekfetch');
const Constants = require('../../util/Constants');
const { Error } = require('../../errors');
class APIRequest {
constructor(rest, method, path, options) {
@@ -28,7 +28,7 @@ class APIRequest {
} else if (this.client.token) {
return this.client.token;
}
throw new Error(Constants.Errors.NO_TOKEN);
throw new Error('TOKEN_MISSING');
}
gen() {