This repository has been archived by the owner on Aug 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.js
77 lines (69 loc) · 1.84 KB
/
error.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const util = require('util')
/**
* All errors happening inside zyspawn
*/
class ZyspawnError extends Error {
constructor(message) {
super(message);
this.name = 'ZyspawnError';
}
}
/**
* Errors due to problems of implementation.
*/
class InternalZyspawnError extends ZyspawnError {
constructor(message) {
super("Internal error: " + message);
}
}
/**
* Error when function is missing. Occurs in
* ZygoteInterface.call()
*/
class FunctionMissingError extends ZyspawnError {
/**
* @param {string} message the message correlated with the missing function
*/
constructor(funcname, filename) {
super("Missing function \"" + funcname + "\" in file \"" + filename + "\"");
}
}
/**
* Error when file is missing. Occurs in
* ZygoteInterface.call()
*/
class FileMissingError extends ZyspawnError {
/**
* @param {string} message the message correlated with the missing function
*/
constructor(filename) {
super("Missing file \"" + filename +"\"");
}
}
/**
* Error when a method is called in a wrong state. Occurs in
* ZygoteInterface.call()
* // TODO ...
*/
class InvalidOperationError extends ZyspawnError {
constructor(issue) {
super("Invald operation: " + issue);
}
}
/**
* Error when a method is timesout
* ZygoteInterface.call()
* // TODO ...
*/
class TimeoutError extends ZyspawnError {
constructor(timeoutDesc) {
super("Timeout on: " + timeoutDesc);
}
}
// const {ZyspawnError, InternalZyspawnError, FileMissingError, FunctionMissingError, InvalidOperationError, TimeoutError}
module.exports.ZyspawnError = ZyspawnError;
module.exports.InternalZyspawnError = InternalZyspawnError;
module.exports.FileMissingError = FileMissingError;
module.exports.FunctionMissingError = FunctionMissingError;
module.exports.InvalidOperationError = InvalidOperationError;
module.exports.TimeoutError = TimeoutError;