Skip to content

Commit d11f652

Browse files
committed
use the same status code check pattern
1 parent b9bddff commit d11f652

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/js-sdk/src/volume/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class Volume {
103103
signal: config.getSignal(opts?.requestTimeoutMs),
104104
})
105105

106-
if (res.error?.code === 404) {
106+
if (res.response.status === 404) {
107107
throw new NotFoundError(`Volume ${volumeId} not found`)
108108
}
109109

@@ -139,7 +139,7 @@ export class Volume {
139139
signal: config.getSignal(opts?.requestTimeoutMs),
140140
})
141141

142-
if (res.error?.code === 404) {
142+
if (res.response.status === 404) {
143143
throw new NotFoundError(`Volume ${volumeId} not found`)
144144
}
145145

@@ -202,7 +202,7 @@ export class Volume {
202202
signal: config.getSignal(opts?.requestTimeoutMs),
203203
})
204204

205-
if (res.error?.code === 404) {
205+
if (res.response.status === 404) {
206206
return false
207207
}
208208

0 commit comments

Comments
 (0)