Skip to content

Commit af41b57

Browse files
committed
Remove dead code handleUnsuccessfulApiResponse
1 parent 4a705c3 commit af41b57

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

src/utils/api.mts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,6 @@ import type {
2121

2222
const NO_ERROR_MESSAGE = 'No error message returned'
2323

24-
// TODO: this function is removed after v1.0.0
25-
export function handleUnsuccessfulApiResponse<T extends SocketSdkOperations>(
26-
_name: T,
27-
error: string,
28-
cause: string,
29-
status: number,
30-
): never {
31-
const message = `${error || NO_ERROR_MESSAGE}${cause ? ` (reason: ${cause})` : ''}`
32-
if (status === 401 || status === 403) {
33-
// Lazily access constants.spinner.
34-
const { spinner } = constants
35-
36-
spinner.stop()
37-
38-
throw new AuthError(message)
39-
}
40-
logger.fail(failMsgWithBadge('Socket API returned an error', message))
41-
// eslint-disable-next-line n/no-process-exit
42-
process.exit(1)
43-
}
44-
4524
export type HandleApiCallOptions = {
4625
desc?: string | undefined
4726
spinner?: Spinner | undefined

0 commit comments

Comments
 (0)