fix: masquer les erreurs SQL des connecteurs web
This commit is contained in:
@@ -107,6 +107,7 @@ import { drawBapCartouche } from "./bapCartouche";
|
||||
import { resolveBapExportDestination } from "./exportDestinationResolver";
|
||||
import { startEmailImportService, stopEmailImportService, isEmailImportServiceRunning, triggerEmailCheck, triggerManualEmailCheck, testImapConnection } from "./emailImportService";
|
||||
import { startFolderImportService, stopFolderImportService, isFolderImportServiceRunning } from "./folderImportService";
|
||||
import { getSafeWebImportSourceError, logWebImportSourceSaveFailure } from "./webImportSourcesError";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import { processFreeproExcel } from "./freeproService";
|
||||
import { runFreeproAutoImport, testFreeproConnection, startFreeproAutoJob, stopFreeproAutoJob, frequencyToMs } from "./freeproAutoImport";
|
||||
@@ -2731,7 +2732,14 @@ export const appRouter = router({
|
||||
autoEnabled: z.number().min(0).max(1).default(0),
|
||||
}))
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
return createWebImportSource({ ...input, userId: ctx.user.id });
|
||||
try {
|
||||
return await createWebImportSource({ ...input, userId: ctx.user.id });
|
||||
} catch (error) {
|
||||
// Les erreurs MySQL/Drizzle peuvent contenir la requête et les paramètres saisis.
|
||||
// Elles restent masquées côté navigateur.
|
||||
logWebImportSourceSaveFailure(error);
|
||||
throw getSafeWebImportSourceError(error);
|
||||
}
|
||||
}),
|
||||
|
||||
update: protectedProcedure
|
||||
|
||||
Reference in New Issue
Block a user