improved error handling

This commit is contained in:
2025-09-30 12:59:38 +02:00
parent 9cad1e8b6b
commit 8f9696991f
2 changed files with 13 additions and 1 deletions

View File

@@ -213,7 +213,11 @@ export const createAPIentry = async (apiKey: string, user: string) => {
body: JSON.stringify({ apiKey, user }),
});
if (!response.ok) {
throw new Error("Failed to create API entry");
return {
success: false,
message:
"Fehler beim Erstellen des API Keys. Achten Sie darauf, dass alle Felder ausgefüllt sind und der API Key nicht doppelt vergeben wird.",
};
}
return { success: true };
} catch (error) {