Skip to content

Commit

Permalink
Fix error in server top-level exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
spyysalo committed Feb 17, 2012
1 parent 62754d4 commit 24e3ad1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions server/src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,18 @@ def serve(params, client_ip, client_hostname, cookie_data):
with CONFIG_CHECK_LOCK:
_config_check()
except ConfigurationError, e:
exception_json = e.json()
return cookie_hdrs, ((JSON_HDR, ), dumps(Messager.output_json(exception_json)))
json_dic = {}
e.json(json_dic)
return cookie_hdrs, ((JSON_HDR, ), dumps(Messager.output_json(json_dic)))
# We can now safely read the config
from config import DEBUG

try:
_permission_check()
except PermissionError, e:
exception_json = e.json()
return cookie_hdrs, ((JSON_HDR, ), dumps(Messager.output_json(exception_json)))
json_dic = {}
e.json(json_dic)
return cookie_hdrs, ((JSON_HDR, ), dumps(Messager.output_json(json_dic)))

try:
# Safe region, can throw any exception, has verified installation
Expand Down

0 comments on commit 24e3ad1

Please sign in to comment.