Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
e6192fd4
Commit
e6192fd4
authored
7 years ago
by
Harsha Kethineni
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #854 from scitran/es-down-error
Descriptive error when search is down
parents
37e41871
177d6705
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/handlers/dataexplorerhandler.py
+1
-1
1 addition, 1 deletion
api/handlers/dataexplorerhandler.py
api/web/base.py
+8
-2
8 additions, 2 deletions
api/web/base.py
with
9 additions
and
3 deletions
api/handlers/dataexplorerhandler.py
+
1
−
1
View file @
e6192fd4
...
...
@@ -339,7 +339,6 @@ class DataExplorerHandler(base.RequestHandler):
doc_type
=
'
flywheel
'
,
body
=
body
)[
'
aggregations
'
][
'
results
'
]
return
aggs
@require_login
...
...
@@ -522,6 +521,7 @@ class DataExplorerHandler(base.RequestHandler):
doc_type
=
'
flywheel
'
,
body
=
es_query
)
return
self
.
_process_results
(
results
,
result_type
)
def
_process_results
(
self
,
results
,
result_type
):
...
...
This diff is collapsed.
Click to expand it.
api/web/base.py
+
8
−
2
View file @
e6192fd4
...
...
@@ -14,6 +14,7 @@ from .. import validators
from
..auth.authproviders
import
AuthProvider
,
APIKeyAuthProvider
from
..auth
import
APIAuthProviderException
,
APIUnknownUserException
,
APIRefreshTokenException
from
..dao
import
APIConsistencyException
,
APIConflictException
,
APINotFoundException
,
APIPermissionException
,
APIValidationException
from
elasticsearch
import
ElasticsearchException
from
..dao.hierarchy
import
get_parent_tree
from
..web.request
import
log_access
,
AccessType
...
...
@@ -300,6 +301,7 @@ class RequestHandler(webapp2.RequestHandler):
"""
custom_errors
=
None
message
=
str
(
exception
)
if
isinstance
(
exception
,
webapp2
.
HTTPException
):
code
=
exception
.
code
elif
isinstance
(
exception
,
validators
.
InputValidationException
):
...
...
@@ -325,6 +327,10 @@ class RequestHandler(webapp2.RequestHandler):
custom_errors
=
exception
.
errors
elif
isinstance
(
exception
,
files
.
FileStoreException
):
code
=
400
elif
isinstance
(
exception
,
ElasticsearchException
):
code
=
503
message
=
"
Search is currently down. Try again later.
"
self
.
request
.
logger
.
error
(
traceback
.
format_exc
())
else
:
code
=
500
...
...
@@ -333,9 +339,9 @@ class RequestHandler(webapp2.RequestHandler):
self
.
request
.
logger
.
error
(
tb
)
if
return_json
:
return
util
.
create_json_http_exception_response
(
str
(
exception
)
,
code
,
custom
=
custom_errors
)
return
util
.
create_json_http_exception_response
(
message
,
code
,
custom
=
custom_errors
)
util
.
send_json_http_exception
(
self
.
response
,
str
(
exception
)
,
code
,
custom
=
custom_errors
)
util
.
send_json_http_exception
(
self
.
response
,
message
,
code
,
custom
=
custom_errors
)
def
log_user_access
(
self
,
access_type
,
cont_name
=
None
,
cont_id
=
None
,
multifile
=
False
):
...
...
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