From 4cd621f9398c8749bcf774acb693ebc6e4f29cf6 Mon Sep 17 00:00:00 2001 From: prcrst Date: Sun, 8 Jan 2012 19:13:15 +0100 Subject: [PATCH] Enhance BuildExceptions --- common.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common.py b/common.py index 6d3e8e83..d54ed432 100644 --- a/common.py +++ b/common.py @@ -54,7 +54,7 @@ class vcs: self.remote = remote self.local = local - + # Refresh the local repository - i.e. get the latest code. This # works either by updating if a local copy already exists, or by # cloning from scratch if it doesn't. @@ -384,11 +384,18 @@ def read_metadata(verbose=False): return apps class BuildException(Exception): - def __init__(self, value): + def __init__(self, value, stdout = None, stderr = None): self.value = value + self.stdout = stdout + self.stderr = stderr def __str__(self): - return repr(self.value) + ret = repr(self.value) + if self.stdout: + ret = ret + "\n==== stdout begin ====\n" + str(self.stdout) + "\n==== stdout end ====" + if self.stderr: + ret = ret + "\n==== stderr begin ====\n" + str(self.stderr) + "\n==== stderr end ====" + return ret class VCSException(Exception): def __init__(self, value): -- 2.30.2