Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/docs/content/specs/clients.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ components:
error:
key: "database_error"
message: "Could not add to gravity database"
hint: "Client already exists (UNIQUE constraint failed)"
hint: "The item is already present"
took: 0.003
parameters:
client:
Expand Down
2 changes: 1 addition & 1 deletion src/api/docs/content/specs/domains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ components:
error:
key: "database_error"
message: "Could not add to gravity database"
hint: "Domain already exists (UNIQUE constraint failed)"
hint: "The item is already present"
took: 0.003
regex_error:
invalid_regex:
Expand Down
2 changes: 1 addition & 1 deletion src/api/docs/content/specs/groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ components:
error:
key: "database_error"
message: "Could not add to gravity database"
hint: "Group already exists (UNIQUE constraint failed)"
hint: "The item is already present"
took: 0.003

parameters:
Expand Down
2 changes: 1 addition & 1 deletion src/api/docs/content/specs/lists.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ components:
error:
key: "database_error"
message: "Could not add to gravity database"
hint: "List already exists (UNIQUE constraint failed)"
hint: "The item is already present"
took: 0.003
parameters:
list:
Expand Down
5 changes: 4 additions & 1 deletion src/database/gravity-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,10 @@ bool gravityDB_addToTable(const enum gravity_list_type listtype, tablerow *row,
}
else
{
*message = sqlite3_errmsg(gravity_db);
if(rc == SQLITE_CONSTRAINT)
*message = "The item is already present";
else
*message = sqlite3_errmsg(gravity_db);
}

// Finalize statement and close database handle
Expand Down
Loading