- Rename error handler.

- Truncate errors.
- Better error tags, release version etc.
This commit is contained in:
Andras Bacsai
2022-02-14 09:28:37 +01:00
parent 70d3448110
commit b4a418dded
95 changed files with 260 additions and 226 deletions

View File

@@ -1,6 +1,6 @@
import { getUserDetails } from '$lib/common';
import * as db from '$lib/database';
import { PrismaErrorHandler } from '$lib/database';
import { ErrorHandler } from '$lib/database';
import type { RequestHandler } from '@sveltejs/kit';
export const post: RequestHandler = async (event) => {
@@ -12,6 +12,6 @@ export const post: RequestHandler = async (event) => {
const { id } = await db.newSource({ name, teamId, type, htmlUrl, apiUrl, organization });
return { status: 201, body: { id } };
} catch (e) {
return PrismaErrorHandler(e);
return ErrorHandler(e);
}
};