diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-03-18 12:15:31 +0100 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-03-18 12:15:31 +0100 |
commit | 4231c4f558ca3b5610db9e4f2fd12d1d550d3012 (patch) | |
tree | 7af26dbac843acbe05ad5d99b553d7f291aa1d6f | |
parent | 01e26fc2dc4ad9d70633ef8413870000508fa6b6 (diff) |
oven: print the original tracebac in build step errors
-rw-r--r-- | cerbero/build/oven.py | 6 | ||||
-rw-r--r-- | cerbero/errors.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cerbero/build/oven.py b/cerbero/build/oven.py index d49df06..b73c48a 100644 --- a/cerbero/build/oven.py +++ b/cerbero/build/oven.py @@ -18,6 +18,7 @@ import tempfile import shutil +import traceback from cerbero.errors import BuildStepError, FatalError from cerbero.build.recipe import Recipe, BuildSteps @@ -103,9 +104,8 @@ class Oven (object): self.cookbook.update_step_status(recipe.name, step) except FatalError: self._handle_build_step_error(recipe, step) - except Exception, ex: - raise FatalError(_("Error performing step %s: %s") % (step, - ex)) + except Exception: + raise BuildStepError(recipe, step, traceback.format_exc()) self.cookbook.update_build_status(recipe.name, False) if self.missing_files: diff --git a/cerbero/errors.py b/cerbero/errors.py index b3f06b6..b723ee0 100644 --- a/cerbero/errors.py +++ b/cerbero/errors.py @@ -47,9 +47,9 @@ class CommandError(CerberoException): class BuildStepError(CerberoException): - def __init__(self, recipe, step): + def __init__(self, recipe, step, trace=''): CerberoException.__init__(self, _("Recipe '%s' failed at the build " - "step '%s'") % (recipe, step)) + "step '%s'\n%s") % (recipe, step, trace)) class RecipeNotFoundError(CerberoException): |