mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-13 21:02:56 +08:00
🔧 Filter out more known errors/message from Sentry
This commit is contained in:
parent
bbb90b529b
commit
fcef3da442
@ -7,6 +7,15 @@ const ignoreTrpcMessages = [
|
||||
"timeout reached",
|
||||
"Missing startParams",
|
||||
"need to be authenticated to perform this action",
|
||||
"current block does not expect file upload",
|
||||
"couldn't find credentials in database",
|
||||
"start group doesn't exist",
|
||||
];
|
||||
|
||||
const ignoreMessages = [
|
||||
"could not find credentials",
|
||||
"is in reply state",
|
||||
"point to another phone ID",
|
||||
];
|
||||
|
||||
Sentry.init({
|
||||
@ -15,6 +24,13 @@ Sentry.init({
|
||||
tracesSampleRate: 1,
|
||||
beforeSend: (event, hint) => {
|
||||
const exception = hint.originalException;
|
||||
if (
|
||||
typeof exception === "string" &&
|
||||
ignoreMessages.some((message) =>
|
||||
exception.toLowerCase().includes(message.toLowerCase()),
|
||||
)
|
||||
)
|
||||
return null;
|
||||
if (isTrpcError(exception)) {
|
||||
if (
|
||||
ignoreTrpcMessages.some((message) =>
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
"exportResults": "tsx src/exportResults.ts",
|
||||
"updateUserEmail": "SKIP_ENV_CHECK=true dotenv -e ./.env.production -- tsx src/updateUserEmail.ts",
|
||||
"inspectChatSession": "tsx src/inspectChatSession.ts",
|
||||
"inspectCredentials": "tsx src/inspectCredentials.ts",
|
||||
"deleteChatSession": "tsx src/deleteChatSession.ts",
|
||||
"checkDependencies": "tsx src/checkDependencies.ts",
|
||||
"readCsvAndDoSomething": "SKIP_ENV_CHECK=true dotenv -e ./.env.production -- tsx src/readCsvAndDoSomething.ts"
|
||||
|
||||
32
packages/scripts/src/inspectCredentials.ts
Normal file
32
packages/scripts/src/inspectCredentials.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import * as p from "@clack/prompts";
|
||||
import prisma from "@typebot.io/prisma";
|
||||
import { promptAndSetEnvironment } from "./utils";
|
||||
|
||||
const inspectCredentials = async () => {
|
||||
await promptAndSetEnvironment("production");
|
||||
|
||||
const id = await p.text({
|
||||
message: "Credentials ID?",
|
||||
});
|
||||
|
||||
if (!id || typeof id !== "string") {
|
||||
console.log("No ID provided");
|
||||
return;
|
||||
}
|
||||
|
||||
const credentials = await prisma.credentials.findFirst({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
select: {
|
||||
name: true,
|
||||
workspaceId: true,
|
||||
},
|
||||
});
|
||||
|
||||
console.log({
|
||||
credentials,
|
||||
});
|
||||
};
|
||||
|
||||
inspectCredentials();
|
||||
Loading…
Reference in New Issue
Block a user