1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var RIS = RIS || {};
// This class contains the customized error class.
PWC.ApplicationError = (function () {
'use strict';
var applicationError = function () {
var tmp = Error.prototype.constructor.apply(this, arguments);
this.message = tmp.message;
this.name = "PWC.ApplicationError";
// Generate stack trace, for now Firefox and Chrome support it, but IE not.
var err = new Error();
if (err.stack) {
this.stack = err.stack;
}
//we should define how our toString function works as this will be used internally
//by the browser's stack trace generation function
this.toString = function () {
return this.name + ': ' + this.message;
};
return this;
}
applicationError.prototype = new Error();
applicationError.prototype.constructor = applicationError;
return applicationError;
})();
PWC.ServiceError = (function () {
'use strict';
var serviceError = function () {
var tmp = PWC.ApplicationError.prototype.constructor.apply(this, arguments);
this.message = tmp.message;
this.name = "PWC.ServiceError";
return this;
}
serviceError.prototype = new PWC.ApplicationError();
serviceError.prototype.constructor = PWC.ServiceError;
return serviceError;
})();