-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/prevent already member to be invited again (#189)
* FEAT/isPgError utils added * REFACTOR/transaction added * CHORE/updated * FIX/prevent already member to be invited again
- Loading branch information
1 parent
452486f
commit 2ea75b6
Showing
4 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { PostgresError } from "postgres"; | ||
|
||
export const isPgError = (error: unknown): error is PostgresError => { | ||
if (!(error instanceof Error)) { | ||
return false; | ||
} | ||
|
||
return error.constructor.name === "PostgresError"; | ||
}; |