refactor: consolidate error handlers to use getServerErrorFromUnknown (#25114)
* refactor: consolidate error handlers to use getServerErrorFromUnknown - Migrate server-only code to use getServerErrorFromUnknown for better error handling - Add JSDoc documentation to both getErrorFromUnknown and getServerErrorFromUnknown - Update webhook handlers, payment services, email service, and booking service - Keep getErrorFromUnknown for client-side and isomorphic code - Improve error message extraction by using err.cause?.stack instead of err.stack - Fix ESLint warnings: replace 'any' with 'unknown' types, fix hasOwnProperty usage Co-Authored-By: [email protected] <[email protected]> * Update packages/app-store/paypal/api/webhook.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * refactor --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
12 files changed
+61
-38
No files matched your search
@@ -3,9 +3,9 @@ import { z } from "zod";
|
||||
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { FeaturesRepository } from "@calcom/features/flags/features.repository";
|
||||
import { getErrorFromUnknown } from "@calcom/lib/errors";
|
||||
import isSmsCalEmail from "@calcom/lib/isSmsCalEmail";
|
||||
import { serverConfig } from "@calcom/lib/serverConfig";
|
||||
import { getServerErrorFromUnknown } from "@calcom/lib/server/getServerErrorFromUnknown";
|
||||
import { setTestEmail } from "@calcom/lib/testEmails";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
|
||||
@@ -77,7 +77,7 @@ export default class BaseEmail {
|
||||
payloadWithUnEscapedSubject,
|
||||
(_err, info) => {
|
||||
if (_err) {
|
||||
const err = getErrorFromUnknown(_err);
|
||||
const err = getServerErrorFromUnknown(_err);
|
||||
this.printNodeMailerError(err);
|
||||
reject(err);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user