mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 14:27:59 +00:00
Fix wrong db error type used
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import knex from "knex";
|
import knex from "knex";
|
||||||
import mysql, { Connection } from "mysql2/promise";
|
import mysql, { Connection } from "mysql2/promise";
|
||||||
|
import { DatabaseError } from "pg";
|
||||||
import tls, { PeerCertificate } from "tls";
|
import tls, { PeerCertificate } from "tls";
|
||||||
|
|
||||||
import { verifyHostInputValidity } from "@app/ee/services/dynamic-secret/dynamic-secret-fns";
|
import { verifyHostInputValidity } from "@app/ee/services/dynamic-secret/dynamic-secret-fns";
|
||||||
@@ -93,7 +94,7 @@ const makeSqlConnection = (
|
|||||||
try {
|
try {
|
||||||
await client.raw(SIMPLE_QUERY);
|
await client.raw(SIMPLE_QUERY);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof BadRequestError) {
|
if (error instanceof DatabaseError) {
|
||||||
// Hacky way to know if we successfully hit the database.
|
// Hacky way to know if we successfully hit the database.
|
||||||
// TODO: potentially two approaches to solve the problem.
|
// TODO: potentially two approaches to solve the problem.
|
||||||
// 1. change the work flow, add account first then resource
|
// 1. change the work flow, add account first then resource
|
||||||
|
|||||||
Reference in New Issue
Block a user