-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVectorErrors.ts
34 lines (30 loc) · 1.13 KB
/
VectorErrors.ts
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
export class ConstructorVectorError extends Error {
constructor(message: string = 'Vector could not be constructed') {
super(message);
Object.setPrototypeOf(this, ConstructorVectorError.prototype);
}
}
export class MissingComponentVectorError extends Error {
constructor(message: string = 'Vector does not have this component') {
super(message);
Object.setPrototypeOf(this, MissingComponentVectorError.prototype);
}
}
export class DimensionsVectorError extends Error {
constructor(message: string = 'Vector does not have the right dimensions') {
super(message);
Object.setPrototypeOf(this, DimensionsVectorError.prototype);
}
}
export class NoLengthVectorError extends Error {
constructor(message: string = 'Vector does not have a length') {
super(message);
Object.setPrototypeOf(this, NoLengthVectorError.prototype);
}
}
export class IncompatibilityVectorError extends Error {
constructor(message: string = 'Vectors are not compatible for this operation') {
super(message);
Object.setPrototypeOf(this, NoLengthVectorError.prototype);
}
}