about summary refs log tree commit diff
path: root/src/lib/media/video/errors.ts
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-09-07 19:27:32 +0100
committerGitHub <noreply@github.com>2024-09-07 19:27:32 +0100
commit45a719b256173f98b20457cc80b4288e84f1c33f (patch)
treec377172ddaae5469ba6fb54457687f590339ed8e /src/lib/media/video/errors.ts
parentb7d78fe59b73294ac13baa51a6a7cd94698cb205 (diff)
downloadvoidsky-45a719b256173f98b20457cc80b4288e84f1c33f.tar.zst
[Video] Check upload limits before uploading (#5153)
* DRY up video service auth code

* throw error if over upload limits

* use token

* xmark on toast

* errors with nice translatable error messages

* Update src/state/queries/video/video.ts

---------

Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/lib/media/video/errors.ts')
-rw-r--r--src/lib/media/video/errors.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/media/video/errors.ts b/src/lib/media/video/errors.ts
index a06a239e1..1c55a9ee9 100644
--- a/src/lib/media/video/errors.ts
+++ b/src/lib/media/video/errors.ts
@@ -11,3 +11,10 @@ export class ServerError extends Error {
     this.name = 'ServerError'
   }
 }
+
+export class UploadLimitError extends Error {
+  constructor(message: string) {
+    super(message)
+    this.name = 'UploadLimitError'
+  }
+}