Skip to content

Commit 90adbd2

Browse files
committed
refactor: throw instead of reject because it is shorter
1 parent eb122b7 commit 90adbd2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/database/useDatabaseRef.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function _useDatabaseRef(
112112
if (promise.value === newPromise) {
113113
error.value = reason
114114
}
115-
return Promise.reject(reason) // propagate the error
115+
throw reason // propagate the error
116116
})
117117
.finally(() => {
118118
// ensure the current promise is still valid

src/server/app-check.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ export function VueFireAppCheckServer(
5151
expireTimeMillis,
5252
}
5353
})
54+
.catch((reason) => {
55+
console.error(
56+
'[VueFire]: Error getting AppCheck token from the server:',
57+
reason
58+
)
59+
throw reason
60+
})
5461
},
5562
}),
5663
isTokenAutoRefreshEnabled: false,

0 commit comments

Comments
 (0)