File tree 4 files changed +7
-12
lines changed
4 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import process from 'node:process'
3
3
4
4
import { betterAjvErrors } from '@apideck/better-ajv-errors'
5
5
import meow from 'meow'
6
- import { ErrorWithCause } from 'pony-cause'
7
6
8
7
import { SocketValidationError , readSocketConfig } from '@socketsecurity/config'
9
8
import { Spinner } from '@socketsecurity/registry/lib/spinner'
@@ -188,7 +187,7 @@ async function setupCommand(
188
187
. join ( '\n' )
189
188
)
190
189
} else {
191
- throw new ErrorWithCause ( 'Failed to read socket.yml config' , { cause } )
190
+ throw new Error ( 'Failed to read socket.yml config' , { cause } )
192
191
}
193
192
}
194
193
)
@@ -206,7 +205,7 @@ async function setupCommand(
206
205
return ( res as SocketSdkReturnType < 'getReportSupportedFiles' > ) . data
207
206
} )
208
207
. catch ( ( cause : Error ) => {
209
- throw new ErrorWithCause ( 'Failed getting supported files for report' , {
208
+ throw new Error ( 'Failed getting supported files for report' , {
210
209
cause
211
210
} )
212
211
} )
Original file line number Diff line number Diff line change 1
1
import process from 'node:process'
2
2
3
3
import meow from 'meow'
4
- import { ErrorWithCause } from 'pony-cause'
5
4
import colors from 'yoctocolors-cjs'
6
5
7
6
import { Spinner } from '@socketsecurity/registry/lib/spinner'
@@ -140,8 +139,9 @@ export async function fetchReportData(
140
139
} catch ( err ) {
141
140
if (
142
141
retry >= MAX_TIMEOUT_RETRY ||
143
- ! ( err instanceof ErrorWithCause ) ||
144
- err . cause ?. cause ?. response ?. statusCode !== 524
142
+ ! ( err instanceof Error ) ||
143
+ // The 524 HTTP status code indicates a timeout.
144
+ ( err . cause as any ) ?. cause ?. response ?. statusCode !== 524
145
145
) {
146
146
throw err
147
147
}
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import readline from 'node:readline/promises'
3
3
4
4
import meow from 'meow'
5
5
import open from 'open'
6
- import { ErrorWithCause } from 'pony-cause'
7
6
import colors from 'yoctocolors-cjs'
8
7
9
8
import { Spinner } from '@socketsecurity/registry/lib/spinner'
@@ -159,7 +158,7 @@ async function setupCommand(
159
158
. catch (
160
159
/** @type {(cause: Error) => never } */
161
160
cause => {
162
- throw new ErrorWithCause ( 'Failed getting supported files for report' , {
161
+ throw new Error ( 'Failed getting supported files for report' , {
163
162
cause
164
163
} )
165
164
}
Original file line number Diff line number Diff line change 1
1
import process from 'node:process'
2
2
3
- import { ErrorWithCause } from 'pony-cause'
4
3
import colors from 'yoctocolors-cjs'
5
4
6
5
import { AuthError } from './errors'
@@ -40,13 +39,11 @@ export async function handleApiCall<T>(
40
39
description : string
41
40
) : Promise < T > {
42
41
let result : T
43
-
44
42
try {
45
43
result = await value
46
44
} catch ( cause ) {
47
- throw new ErrorWithCause ( `Failed ${ description } ` , { cause } )
45
+ throw new Error ( `Failed ${ description } ` , { cause } )
48
46
}
49
-
50
47
return result
51
48
}
52
49
You can’t perform that action at this time.
0 commit comments