summaryrefslogtreecommitdiff
path: root/app/Exceptions/FileUploadException.php
diff options
context:
space:
mode:
authorgrothedev <grothedev@gmail.com>2025-12-28 22:16:11 -0500
committergrothedev <grothedev@gmail.com>2025-12-28 22:16:11 -0500
commit57445d4ccbfe1cb190437c8f6b609fc83723b015 (patch)
tree2e4f50e834faceb068502d231ad2c9cc30067f9b /app/Exceptions/FileUploadException.php
had claude code start making this project just to see what happens
Diffstat (limited to 'app/Exceptions/FileUploadException.php')
-rw-r--r--app/Exceptions/FileUploadException.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/app/Exceptions/FileUploadException.php b/app/Exceptions/FileUploadException.php
new file mode 100644
index 0000000..9217c5c
--- /dev/null
+++ b/app/Exceptions/FileUploadException.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Exceptions;
+
+use Exception;
+
+class FileUploadException extends Exception
+{
+ public static function fileTooLarge(int $maxSize)
+ {
+ return new self("File exceeds maximum size of {$maxSize}KB");
+ }
+
+ public static function invalidMimeType(string $mimeType)
+ {
+ return new self("File type '{$mimeType}' is not allowed");
+ }
+
+ public static function invalidExtension(string $extension)
+ {
+ return new self("File extension '.{$extension}' is not allowed");
+ }
+
+ public static function chunkMismatch(string $uploadId)
+ {
+ return new self("Chunk validation failed for upload {$uploadId}");
+ }
+
+ public static function chunksIncomplete(string $uploadId, int $expected, int $found)
+ {
+ return new self("Incomplete chunks for upload {$uploadId}: expected {$expected}, found {$found}");
+ }
+
+ public static function storageError(string $message)
+ {
+ return new self("Storage error: {$message}");
+ }
+
+ public static function tooManyFiles(int $max)
+ {
+ return new self("Maximum of {$max} files can be uploaded at once");
+ }
+}