Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
feat(MongoTimeoutError): add common class for timeout events
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed May 23, 2018
1 parent a7f653b commit c5b4752
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions lib/error.js
Expand Up @@ -66,7 +66,7 @@ util.inherits(MongoNetworkError, MongoError);
* @class
* @param {Error|string|object} message The error message
* @property {string} message The error message
* @return {MongoParseError} A MongoNetworkError instance
* @return {MongoParseError} A MongoParseError instance
* @extends {MongoError}
*/
const MongoParseError = function(message) {
Expand All @@ -75,8 +75,24 @@ const MongoParseError = function(message) {
};
util.inherits(MongoParseError, MongoError);

/**
* An error signifying a timeout event
*
* @class
* @param {Error|string|object} message The error message
* @property {string} message The error message
* @return {MongoTimeoutError} A MongoTimeoutError instance
* @extends {MongoError}
*/
const MongoTimeoutError = function(message) {
MongoError.call(this, message);
this.name = 'MongoTimeoutError';
};
util.inherits(MongoTimeoutError, MongoError);

module.exports = {
MongoError: MongoError,
MongoNetworkError: MongoNetworkError,
MongoParseError: MongoParseError
MongoError,
MongoNetworkError,
MongoParseError,
MongoTimeoutError
};

0 comments on commit c5b4752

Please sign in to comment.