UNPKG

778 BJavaScriptView Raw
1/** @license MIT License (c) copyright 2010-2014 original author or authors */
2/** @author Brian Cavalier */
3/** @author John Hann */
4
5(function(define) { 'use strict';
6define(function() {
7
8 /**
9 * Custom error type for promises rejected by promise.timeout
10 * @param {string} message
11 * @constructor
12 */
13 function TimeoutError (message) {
14 Error.call(this);
15 this.message = message;
16 this.name = TimeoutError.name;
17 if (typeof Error.captureStackTrace === 'function') {
18 Error.captureStackTrace(this, TimeoutError);
19 }
20 }
21
22 TimeoutError.prototype = Object.create(Error.prototype);
23 TimeoutError.prototype.constructor = TimeoutError;
24
25 return TimeoutError;
26});
27}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
\No newline at end of file