First Commit. Duplicate bunext-sqlite preset

This commit is contained in:
2026-10-18 16:47:11 +01:00
commit 81e4a8aecc
718 changed files with 41695 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import AppError from "./app-error";
type Params = {
error: unknown;
fallback?: string;
};
/**
* # Safe Error Message
* Returns the message of an `AppError` (deliberate, user-facing) and a
* generic fallback for everything else, so internal details (SQL errors,
* file paths, stack messages) never reach the client.
*/
export default function safeErrorMessage({
error,
fallback = "Something went wrong. Please try again.",
}: Params): string {
if (error instanceof AppError) {
return error.message;
}
return fallback;
}