Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
raven
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rune Åvar Ødegård
raven
Commits
80ff20fb
Commit
80ff20fb
authored
2 years ago
by
Christoffer Stoll
Browse files
Options
Downloads
Patches
Plain Diff
bug: move exception so it doies not catch the badrequest
parent
a8c38beb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/api/imports/observations/observations.py
+7
-8
7 additions, 8 deletions
web/api/imports/observations/observations.py
with
7 additions
and
8 deletions
web/api/imports/observations/observations.py
+
7
−
8
View file @
80ff20fb
...
...
@@ -33,19 +33,20 @@ def logger_post():
loggerModel
=
Binder
.
bind_and_validate
(
loggerHandler
.
get_validation_rules
())
try
:
obsModel
=
loggerHandler
.
handle
(
loggerModel
)
obsModel
=
loggerHandler
.
handle
(
loggerModel
)
except
Exception
as
e
:
raise
InternalServerError
(
description
=
str
(
e
))
if
obsModel
is
None
:
raise
BadRequest
(
description
=
"
One or more logger id was not found
"
)
try
:
obsHandler
.
handle
(
obsModel
)
return
Responses
.
plain
(
"
Created
"
,
201
)
except
Exception
as
e
:
raise
InternalServerError
(
description
=
str
(
e
))
@obs.route
(
"
/imports/logger
"
,
methods
=
[
'
GET
'
])
@User.basicauth_required
def
logger_get
():
...
...
@@ -54,12 +55,10 @@ def logger_get():
try
:
lastentry
=
lastEntryHandler
.
handle
(
model
)
if
lastentry
is
None
:
raise
BadRequest
(
description
=
"
Logger id not found
"
)
return
Responses
.
json
({
"
lastEntry
"
:
lastentry
[
"
to_time
"
]})
except
Exception
as
e
:
raise
InternalServerError
(
description
=
str
(
e
))
if
lastentry
is
None
:
raise
BadRequest
(
description
=
"
Logger id not found
"
)
return
Responses
.
json
({
"
lastEntry
"
:
lastentry
[
"
to_time
"
]})
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