Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PEDASI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
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
Research Software Group
PEDASI
Commits
6ae233cf
Commit
6ae233cf
authored
6 years ago
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
Pass through upstream HttpErrors - fixes error trace when running tests
parent
eda697d6
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
api/views/datasources.py
+6
-0
6 additions, 0 deletions
api/views/datasources.py
with
6 additions
and
0 deletions
api/views/datasources.py
+
6
−
0
View file @
6ae233cf
...
...
@@ -8,7 +8,9 @@ import typing
from
django.db.models
import
ObjectDoesNotExist
from
django.http
import
HttpResponse
,
JsonResponse
from
rest_framework
import
decorators
,
request
,
response
,
viewsets
from
requests.exceptions
import
HTTPError
from
..
import
permissions
from
datasources
import
models
,
serializers
...
...
@@ -134,6 +136,10 @@ class DataSourceApiViewset(viewsets.ReadOnlyModelViewSet):
}
return
response
.
Response
(
data
,
status
=
400
)
except
HTTPError
as
e
:
# Pass upstream errors through
return
response
.
Response
(
e
.
response
.
text
,
status
=
e
.
response
.
status_code
)
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
"""
List the queryset after filtering by request query parameters for data source metadata.
...
...
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