@authhero/kysely-adapter 11.8.5 → 11.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -898,7 +898,8 @@ function Ye(e) {
|
|
|
898
898
|
try {
|
|
899
899
|
await e.insertInto("tenants").values(i).execute();
|
|
900
900
|
} catch (e) {
|
|
901
|
-
|
|
901
|
+
let t = e?.message ?? "";
|
|
902
|
+
throw t.includes("UNIQUE constraint failed") || t.includes("Duplicate entry") || t.includes("duplicate key") || t.includes("AlreadyExists") || e?.code === "SQLITE_CONSTRAINT" || e?.code === "SQLITE_CONSTRAINT_UNIQUE" || e?.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || e?.code === "ER_DUP_ENTRY" || e?.code === "23505" ? new D(409, { message: `Tenant with ID '${r.id}' already exists` }) : e;
|
|
902
903
|
}
|
|
903
904
|
return r;
|
|
904
905
|
};
|