Skip to content

Commit f5d3d77

Browse files
committed
fix(deploy): catch Exception instead of RuntimeError
In the deploy function Exception is caught, problem logged and then re-raised. Best to catch Exception as well to clean up the release object around it Potentially affects the following tickets: #410, #319, #187, #320
1 parent eb4fde6 commit f5d3d77

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

rootfs/api/models/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def create(self, user, *args, **kwargs):
4343
try:
4444
self.app.deploy(user, new_release)
4545
return new_release
46-
except RuntimeError:
46+
except Exception:
4747
if 'new_release' in locals():
4848
new_release.delete()
4949
raise

rootfs/api/models/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def rollback(self, user, version):
115115
if self.build is not None:
116116
self.app.deploy(user, new_release)
117117
return new_release
118-
except RuntimeError:
118+
except Exception:
119119
if 'new_release' in locals():
120120
new_release.delete()
121121
raise

rootfs/api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def post_save(self, config):
316316
# It's possible to set config values before a build
317317
if self.release.build is not None:
318318
config.app.deploy(self.request.user, self.release)
319-
except RuntimeError:
319+
except Exception:
320320
self.release.delete()
321321
raise
322322

0 commit comments

Comments
 (0)