firstboot: improve error reporting

This commit is contained in:
Marek Marczykowski-Górecki 2015-11-28 16:04:24 +01:00
parent ecac7cb908
commit c4ee550b49
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -203,9 +203,11 @@ class moduleClass(Module):
self.process_error = None self.process_error = None
else: else:
self.process_error = "{} failed:\n{}".format(command, out) self.process_error = "{} failed:\n{}".format(command, out)
raise Exception(self.process_error)
except Exception as e: except Exception as e:
self.process_error = str(e) self.process_error = str(e)
if self.process_error:
# not only inform main thread, but also interrupt task thread
raise Exception(self.process_error)
def run_in_thread(self, method, args = None): def run_in_thread(self, method, args = None):
thread = threading.Thread(target=method, args = (args if args else ())) thread = threading.Thread(target=method, args = (args if args else ()))