This commit is contained in:
Tommy D. Rossi
2025-12-30 14:25:19 +01:00
parent b19b7ae72d
commit 3decc28242
16 changed files with 612 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { captureException, flush, init } from "sentries";
init({
dsn: "https://3e3f1075fec9ee2de1e0f79026b5f734@o4508014272446464.ingest.de.sentry.io/4508014292697168",
integrations: [],
tracesSampleRate: 0.01,
profilesSampleRate: 0.01,
beforeSend(event) {
if (process.env.NODE_ENV === "development") {
return null;
}
if (process.env.BYTECODE_RUN) {
return null;
}
if (event?.["name"] === "AbortError") {
return null;
}
return event;
},
});
export async function notifyError(error: any, msg?: string) {
console.error(msg, error);
captureException(error, { extra: { msg } });
await flush(1000);
}
export class AppError extends Error {
constructor(message: string) {
super(message);
this.name = "AppError";
}
}
+10
View File
@@ -0,0 +1,10 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export const sleep = (ms: number): Promise<void> => {
return new Promise((resolve) => setTimeout(resolve, ms));
};
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}