summaryrefslogtreecommitdiff
path: root/packages/db/src/runtime/utils.ts
diff options
context:
space:
mode:
authorGravatar Arsh <69170106+lilnasy@users.noreply.github.com> 2024-04-02 21:07:28 +0530
committerGravatar GitHub <noreply@github.com> 2024-04-02 11:37:28 -0400
commit713f99e849b26edb831ea6527b7103ad7a6b200f (patch)
treeb96955c7198ca1ff0f61a8e0d865b0c357efb048 /packages/db/src/runtime/utils.ts
parent51112ab3f1b134740e8307743bbb15cb0d8bdbb3 (diff)
downloadastro-713f99e849b26edb831ea6527b7103ad7a6b200f.tar.gz
astro-713f99e849b26edb831ea6527b7103ad7a6b200f.tar.zst
astro-713f99e849b26edb831ea6527b7103ad7a6b200f.zip
fix(db): isolate AstroDbError from core utils (#10646)
* fix(db): isolate AstroDbError from core utils * add changeset
Diffstat (limited to 'packages/db/src/runtime/utils.ts')
-rw-r--r--packages/db/src/runtime/utils.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/db/src/runtime/utils.ts b/packages/db/src/runtime/utils.ts
index 29160b22d..ac6cfeda6 100644
--- a/packages/db/src/runtime/utils.ts
+++ b/packages/db/src/runtime/utils.ts
@@ -1,3 +1,5 @@
+import { AstroError } from 'astro/errors';
+
/**
* Small wrapper around fetch that throws an error if the response is not OK. Allows for custom error handling as well through the onNotOK callback.
*/
@@ -16,3 +18,7 @@ export async function safeFetch(
return response;
}
+
+export class AstroDbError extends AstroError {
+ name = 'Astro DB Error';
+}