Revise PR based on coderabbit, greptile review

This commit is contained in:
Tuan Dang
2025-04-30 19:39:02 -07:00
parent 7811178261
commit ae43435509
19 changed files with 66 additions and 77 deletions
@@ -2,7 +2,7 @@ import { Knex } from "knex";
import { TDbClient } from "@app/db";
import { TableName } from "@app/db/schemas";
import { DatabaseError } from "@app/lib/errors";
import { BadRequestError, DatabaseError } from "@app/lib/errors";
import { groupBy, unique } from "@app/lib/fn";
import { ormify } from "@app/lib/knex";
@@ -155,7 +155,9 @@ export const sshHostGroupDALFactory = (db: TDbClient) => {
.first();
if (!sshHostGroup) {
throw new Error(`SSH host group with ID ${sshHostGroupId} not found`);
throw new BadRequestError({
message: `SSH host group with ID ${sshHostGroupId} not found`
});
}
const query = db