improve log

This commit is contained in:
Sylvain LE GAL 2022-06-29 21:03:06 +02:00
parent 798e27ab16
commit a9f7fa3568

View File

@ -91,10 +91,16 @@ def execute_sql_file(ctx, database, sql_file):
) )
docker_result = container.exec_run(docker_command) docker_result = container.exec_run(docker_command)
if docker_result.exit_code != 0: if docker_result.exit_code != 0:
logger.error(docker_result.output)
raise Exception( raise Exception(
"The script '%s' failed on database %s. Exit Code : %d" "The script '%s' failed on database %s.\n"
% (relative_path, database, docker_result.exit_code) "- Exit Code : %d\n"
"- Output: %s"
% (
relative_path,
database,
docker_result.exit_code,
docker_result.output,
)
) )