-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88f9bb7
commit 9923804
Showing
8 changed files
with
37 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* This is a substring of the database's foreign key constraint error message, used to catch | ||
* foreign key constraint errors when trying to delete a record and displaying a more useful error message | ||
* | ||
* ie. While trying to delete a device: | ||
* | ||
* if (error.includes(FOREIGN_KEY_CONSTRAINT_ERROR)) { | ||
* return "Delete the associated deployment before deleting the device" | ||
* } | ||
* | ||
*/ | ||
export const FOREIGN_KEY_CONSTRAINT_ERROR = 'foreign key constraint'; | ||
|
||
/** | ||
* This is a substring of the database's unique constraint error message, used to catch | ||
* unique constraint errors when trying to insert a record | ||
* | ||
* ie. While trying to create a device: | ||
* | ||
* if (error.includes(UNIQUE_CONSTRAINT_ERROR)) { | ||
* return "That device already eixsts in the Survey" | ||
* } | ||
* | ||
*/ | ||
export const UNIQUE_CONSTRAINT_ERROR = 'already exists'; |
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
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