Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FAIR Sensor Ecosystem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WZL-IQS-Public
Sensor Interfacing Language (SOIL)
FAIR Sensor Ecosystem
Commits
dfbe901e
Commit
dfbe901e
authored
3 years ago
by
Jonas Schlabertz
Browse files
Options
Downloads
Patches
Plain Diff
Improvement to returned HTTP Status Codes.
parent
d455044b
Branches
Branches containing commit
Tags
v18.01.0
Tags containing commit
No related merge requests found
Pipeline
#154038
passed
3 years ago
Stage: lint
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/controller/ComponentInformationController.ts
+2
-1
2 additions, 1 deletion
src/controller/ComponentInformationController.ts
src/controller/TypeDefinitionController.ts
+2
-2
2 additions, 2 deletions
src/controller/TypeDefinitionController.ts
with
4 additions
and
3 deletions
src/controller/ComponentInformationController.ts
+
2
−
1
View file @
dfbe901e
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/controller/TypeDefinitionController.ts
+
2
−
2
View file @
dfbe901e
...
@@ -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
"
)
{
// 4
12
-
Precondition Failed
// 4
09
-
Conflict
response
.
status
(
4
12
);
response
.
status
(
4
09
);
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment