misc: used generic error class instead

This commit is contained in:
Sheen Capadngan
2025-11-04 04:06:13 +08:00
parent 3fbda9112c
commit 9bad74323c

View File

@@ -4,7 +4,7 @@ import tls, { PeerCertificate } from "tls";
import { verifyHostInputValidity } from "@app/ee/services/dynamic-secret/dynamic-secret-fns";
import { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";
import { BadRequestError, DatabaseError } from "@app/lib/errors";
import { BadRequestError } from "@app/lib/errors";
import { GatewayProxyProtocol } from "@app/lib/gateway";
import { withGatewayV2Proxy } from "@app/lib/gateway-v2/gateway-v2";
import { alphaNumericNanoId } from "@app/lib/nanoid";
@@ -96,7 +96,7 @@ const makeSqlConnection = (
try {
await client.raw(SIMPLE_QUERY);
} catch (error) {
if (error instanceof DatabaseError) {
if (error instanceof Error) {
// Hacky way to know if we successfully hit the database.
// TODO: potentially two approaches to solve the problem.
// 1. change the work flow, add account first then resource