diff --git a/scripts/automation_generate.sh b/scripts/automation_generate.sh index 40a1e1ff8764..2a5fc41c5736 100644 --- a/scripts/automation_generate.sh +++ b/scripts/automation_generate.sh @@ -15,3 +15,8 @@ python -m packaging_tools.auto_codegen "$1" "$TMPDIR/venv-sdk/auto_temp.json" 2> echo "[Generate] codegen done!!!" python -m packaging_tools.auto_package "$TMPDIR/venv-sdk/auto_temp.json" "$2" 2>&1 echo "[Generate] generate done!!!" + +if [ ! -f "$2" ]; then + echo "$2 does not exist!!!" + exit 1 +fi \ No newline at end of file diff --git a/tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py b/tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py index 863824ed79df..d9347b9132ec 100644 --- a/tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py +++ b/tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py @@ -137,6 +137,10 @@ def execute_simple_command(cmd_line, cwd=None, shell=False, env=None): process.wait() output = "\n".join(output_buffer) if process.returncode: + # print necessary error info + for i in range(-min(len(output_buffer), 5), 0): + print(f'[Autorest] {output_buffer[i]}') + raise subprocess.CalledProcessError( process.returncode, cmd_line,