Skip to content
Snippets Groups Projects
Commit dfbe901e authored by Jonas Schlabertz's avatar Jonas Schlabertz
Browse files

Improvement to returned HTTP Status Codes.

parent d455044b
Branches
Tags v18.01.0
No related merge requests found
Pipeline #154038 passed
...@@ -115,7 +115,8 @@ export default class ComponentInformationController extends BaseController { ...@@ -115,7 +115,8 @@ export default class ComponentInformationController extends BaseController {
if(information.id != oldVersionId) { if(information.id != oldVersionId) {
// Topic is already related by a information object which is not // Topic is already related by a information object which is not
// the old version. // the old version.
response.status(412); // 409 - Conflict
response.status(409);
this.setJSONLDResponseType(response); this.setJSONLDResponseType(response);
response.send(new APIError("Topic is already in use by another component information.")); response.send(new APIError("Topic is already in use by another component information."));
return; return;
......
...@@ -87,8 +87,8 @@ export default class TypeDefinitionController extends BaseController { ...@@ -87,8 +87,8 @@ export default class TypeDefinitionController extends BaseController {
// Thus in this case someone wants to insert a type definition with a name // Thus in this case someone wants to insert a type definition with a name
// which already exists within the database. // which already exists within the database.
if(error.code == "23505") { if(error.code == "23505") {
// 412 - Precondition Failed // 409 - Conflict
response.status(412); response.status(409);
this.setJSONLDResponseType(response); this.setJSONLDResponseType(response);
response.send(new APIError("A type definition with this name already exists.")); response.send(new APIError("A type definition with this name already exists."));
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment