mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-22 22:22:25 +00:00
Return proper JSON error when something goes wrong on any endpoint
This commit is contained in:
parent
f68c1f0bde
commit
ff4fc5eb8b
@ -231,7 +231,6 @@ class ProjectHandler:
|
||||
controller = Controller.instance()
|
||||
project = controller.get_project(request.match_info["project_id"])
|
||||
|
||||
|
||||
started = False
|
||||
|
||||
for data in project.export(include_images=bool(request.GET.get("include_images", "0"))):
|
||||
|
@ -161,6 +161,7 @@ class Route(object):
|
||||
if response:
|
||||
return response
|
||||
|
||||
try:
|
||||
# Non API call
|
||||
if api_version is None or raw is True:
|
||||
response = Response(request=request, route=route, output_schema=output_schema)
|
||||
@ -169,7 +170,6 @@ class Route(object):
|
||||
return response
|
||||
|
||||
# API call
|
||||
try:
|
||||
if "controller" in func.__module__ and server_config.getboolean("controller", False) is False:
|
||||
raise aiohttp.web.HTTPForbidden(text="The server is not a controller")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user