forked from launchdarkly/node-server-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.js
More file actions
19 lines (16 loc) · 759 Bytes
/
errors.js
File metadata and controls
19 lines (16 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function createCustomError(name) {
function CustomError(message, code) {
Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
this.message = message;
this.code = code;
}
CustomError.prototype = new Error();
CustomError.prototype.name = name;
CustomError.prototype.constructor = CustomError;
return CustomError;
}
exports.LDPollingError = createCustomError('LaunchDarklyPollingError');
exports.LDStreamingError = createCustomError('LaunchDarklyStreamingError');
exports.LDUnexpectedResponseError = createCustomError('LaunchDarklyUnexpectedResponseError');
exports.LDInvalidSDKKeyError = createCustomError('LaunchDarklyInvalidSDKKeyError');
exports.LDClientError = createCustomError('LaunchDarklyClientError');