1
1
import { isNullOrUndefined } from './utils' ;
2
2
3
3
export class StateError extends Error {
4
- constructor (
5
- public wantedStates : string [ ] ,
6
- public gotState : string
7
- ) {
4
+ constructor ( public wantedStates : string [ ] , public gotState : string ) {
8
5
super (
9
6
`Incorrect State for operation: "${ gotState } ", allowed States: "[${ wantedStates . join (
10
7
','
@@ -22,10 +19,7 @@ export class UnknownLockfileStatusError extends Error {
22
19
}
23
20
24
21
export class UnableToUnlockLockfileError extends Error {
25
- constructor (
26
- public thisInstance : boolean ,
27
- public file : string
28
- ) {
22
+ constructor ( public thisInstance : boolean , public file : string ) {
29
23
super (
30
24
`Cannot unlock file "${ file } ", because it is not locked by this ${
31
25
thisInstance ? 'instance' : 'process'
@@ -41,10 +35,7 @@ export class UnknownPlatformError extends Error {
41
35
}
42
36
43
37
export class UnknownArchitectureError extends Error {
44
- constructor (
45
- public arch : string ,
46
- public platform ?: string
47
- ) {
38
+ constructor ( public arch : string , public platform ?: string ) {
48
39
super ( ) ;
49
40
50
41
if ( ! isNullOrUndefined ( platform ) ) {
@@ -56,10 +47,7 @@ export class UnknownArchitectureError extends Error {
56
47
}
57
48
58
49
export class WaitForPrimaryTimeoutError extends Error {
59
- constructor (
60
- public timeout : number ,
61
- public where ?: string
62
- ) {
50
+ constructor ( public timeout : number , public where ?: string ) {
63
51
super ( `Timed out after ${ timeout } ms while waiting for a Primary (where: "${ where } ")` ) ;
64
52
}
65
53
}
@@ -88,10 +76,7 @@ export class NoSystemBinaryFoundError extends Error {
88
76
}
89
77
90
78
export class Md5CheckFailedError extends Error {
91
- constructor (
92
- public binarymd5 : string ,
93
- public checkfilemd5 : string
94
- ) {
79
+ constructor ( public binarymd5 : string , public checkfilemd5 : string ) {
95
80
super ( `MD5 check failed! Binary MD5 is "${ binarymd5 } ", Checkfile MD5 is "${ checkfilemd5 } "` ) ;
96
81
}
97
82
}
@@ -154,10 +139,7 @@ export class ParseArchiveRegexError extends Error {
154
139
}
155
140
156
141
export class NoRegexMatchError extends Error {
157
- constructor (
158
- public name : string ,
159
- public extra ?: string
160
- ) {
142
+ constructor ( public name : string , public extra ?: string ) {
161
143
super ( ) ;
162
144
const addExtra = ! ! extra ? `(${ extra } )` : '' ;
163
145
this . message = `Expected "${ name } " to have Regex Matches${ addExtra } ` ;
@@ -222,10 +204,7 @@ export class UnknownVersionError extends Error {
222
204
* Error for when downloading fails
223
205
*/
224
206
export class DownloadError extends Error {
225
- constructor (
226
- public url : string ,
227
- public msg : string
228
- ) {
207
+ constructor ( public url : string , public msg : string ) {
229
208
super ( `Download failed for url \"${ url } \", Details:\n${ msg } ` ) ;
230
209
}
231
210
}
0 commit comments