feat: impl directory delete

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2025-09-14 18:12:29 +00:00
parent 5510d9cd8a
commit 67383c1c4e
13 changed files with 454 additions and 202 deletions

24
convex/model/error.ts Normal file
View File

@@ -0,0 +1,24 @@
import { ConvexError } from "convex/values"
export enum Code {
DirectoryExists = "DirectoryExists",
FileExists = "FileExists",
Internal = "Internal",
}
export type ApplicationError = ConvexError<{ code: Code; message: string }>
export function isApplicationError(error: unknown): error is ApplicationError {
return (
error instanceof ConvexError &&
"code" in error.data &&
"message" in error.data
)
}
export function create(code: Code, message: string = "unknown error") {
return new ConvexError({
code,
message,
})
}