Skip to content

Commit

Permalink
catch all exceptions during POOL_UPGRADE dyn vaidation
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Kononykhin <[email protected]>
  • Loading branch information
andkononykhin committed Mar 15, 2019
1 parent b6b453d commit 1cea29b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion indy_node/server/config_req_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def validate(self, req: Request):
if not pkg_to_upgrade:
raise InvalidClientRequest(req.identifier, req.reqId, "Upgrade package name is empty")

res = self.upgrader.check_upgrade_possible(pkg_to_upgrade, targetVersion, reinstall)
try:
res = self.upgrader.check_upgrade_possible(pkg_to_upgrade, targetVersion, reinstall)
except Exception as exc:
res = str(exc)

if res:
raise InvalidClientRequest(req.identifier, req.reqId, res)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ def dynamic_validation(self, request: Request):
if not pkg_to_upgrade:
raise InvalidClientRequest(identifier, req_id, "Upgrade package name is empty")

res = self.upgrader.check_upgrade_possible(pkg_to_upgrade, targetVersion, reinstall)
try:
res = self.upgrader.check_upgrade_possible(pkg_to_upgrade, targetVersion, reinstall)
except Exception as exc:
res = str(exc)

if res:
raise InvalidClientRequest(identifier, req_id, res)

Expand Down

0 comments on commit 1cea29b

Please sign in to comment.