Skip to content

Commit 8150b3c

Browse files
committed
refactor StorageCircuitBreaker.ts
1 parent 9d515ee commit 8150b3c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/storage/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const StorageErrorClass = {
2929
* provider's classifier so they all extract the error the same way.
3030
*/
3131
function getErrorParts(error: unknown): {name: string; message: string} {
32-
if (error instanceof Error || error instanceof DOMException) {
32+
if (error instanceof Error || (typeof DOMException !== 'undefined' && error instanceof DOMException)) {
3333
return {name: (error.name ?? '').toLowerCase(), message: (error.message ?? '').toLowerCase()};
3434
}
3535
return {name: '', message: String(error ?? '').toLowerCase()};

0 commit comments

Comments
 (0)