Refactor for clarity
This commit is contained in:
@@ -251,7 +251,7 @@ def build(options: BuildOptions) -> None:
|
||||
docker.copy_out(container_output_dir, options.output_dir)
|
||||
log.step_end()
|
||||
except subprocess.CalledProcessError as error:
|
||||
log.error(f'Command {error.cmd} failed with code {error.returncode}. {error.stdout}')
|
||||
log.step_end_with_error(f'Command {error.cmd} failed with code {error.returncode}. {error.stdout}')
|
||||
troubleshoot(options.package_dir, error)
|
||||
exit(1)
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class Logger:
|
||||
|
||||
self.step_start_time = None
|
||||
|
||||
def error(self, error: Union[BaseException, str]) -> None:
|
||||
def step_end_with_error(self, error: Union[BaseException, str]) -> None:
|
||||
self.step_end(success=False)
|
||||
print()
|
||||
|
||||
|
||||
@@ -359,5 +359,5 @@ def build(options: BuildOptions) -> None:
|
||||
shutil.move(str(repaired_wheel), options.output_dir)
|
||||
log.build_end()
|
||||
except subprocess.CalledProcessError as error:
|
||||
log.error(f'Command {error.cmd} failed with code {error.returncode}. {error.stdout}')
|
||||
log.step_end_with_error(f'Command {error.cmd} failed with code {error.returncode}. {error.stdout}')
|
||||
exit(1)
|
||||
|
||||
@@ -330,5 +330,5 @@ def build(options: BuildOptions) -> None:
|
||||
shutil.move(str(repaired_wheel), options.output_dir)
|
||||
log.build_end()
|
||||
except subprocess.CalledProcessError as error:
|
||||
log.error(f'Command {error.cmd} failed with code {error.returncode}. {error.stdout}')
|
||||
log.step_end_with_error(f'Command {error.cmd} failed with code {error.returncode}. {error.stdout}')
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user