From 9792d75f47ab84a6f6e4cc5f666f29956d71ef8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ole=C5=9B?= Date: Mon, 11 May 2026 09:59:45 +0200 Subject: [PATCH] Don't hide internal errors --- examples/01_create_sandbox.py | 3 --- examples/01_create_sandbox_async.py | 3 --- examples/02_create_sandbox_with_timing.py | 5 ----- examples/02_create_sandbox_with_timing_async.py | 6 ------ examples/03_basic_commands.py | 3 --- examples/03_basic_commands_async.py | 3 --- examples/04_streaming_output.py | 3 --- examples/04_streaming_output_async.py | 3 --- examples/05_environment_variables.py | 3 --- examples/05_environment_variables_async.py | 3 --- examples/06_working_directory.py | 4 ---- examples/06_working_directory_async.py | 4 ---- examples/07_file_operations.py | 4 ---- examples/07_file_operations_async.py | 4 ---- examples/08_directory_operations.py | 4 ---- examples/08_directory_operations_async.py | 4 ---- examples/09_binary_files.py | 4 ---- examples/09_binary_files_async.py | 4 ---- examples/10_batch_operations.py | 4 ---- examples/10_batch_operations_async.py | 4 ---- examples/11_upload_download.py | 4 ---- examples/11_upload_download_async.py | 4 ---- examples/12_file_manipulation.py | 4 ---- examples/12_file_manipulation_async.py | 4 ---- examples/13_background_processes.py | 4 ---- examples/13_background_processes_async.py | 4 ---- examples/14_expose_port.py | 4 ---- examples/14_expose_port_async.py | 4 ---- examples/15_get_sandbox.py | 4 ---- examples/15_get_sandbox_async.py | 4 ---- examples/16_create_sandbox_with_auto_delete_simple.py | 4 ---- examples/17_create_sandbox_with_auto_delete.py | 4 ---- examples/18_create_sandbox_with_existing_app.py | 4 ---- examples/19_entrypoint_and_command.py | 6 ------ examples/20_config_files.py | 3 --- examples/20_config_files_async.py | 3 --- 36 files changed, 139 deletions(-) diff --git a/examples/01_create_sandbox.py b/examples/01_create_sandbox.py index 6ccad45d..edf3e288 100644 --- a/examples/01_create_sandbox.py +++ b/examples/01_create_sandbox.py @@ -34,9 +34,6 @@ def main(): print(result.stdout.strip()) return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: sandbox.delete() diff --git a/examples/01_create_sandbox_async.py b/examples/01_create_sandbox_async.py index dfcd6488..3ba22972 100644 --- a/examples/01_create_sandbox_async.py +++ b/examples/01_create_sandbox_async.py @@ -36,9 +36,6 @@ async def main(): print(result.stdout.strip()) return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: await sandbox.delete() diff --git a/examples/02_create_sandbox_with_timing.py b/examples/02_create_sandbox_with_timing.py index 492779c5..482c4c2f 100644 --- a/examples/02_create_sandbox_with_timing.py +++ b/examples/02_create_sandbox_with_timing.py @@ -137,11 +137,6 @@ def main(run_long_tests=False): print(f" ✓ took {multi_check_duration:.1f}s") return 0 - except Exception as e: - print(f"\n✗ Error occurred: {e}") - import traceback - traceback.print_exc() - return 1 finally: if sandbox: print(" → Deleting sandbox...") diff --git a/examples/02_create_sandbox_with_timing_async.py b/examples/02_create_sandbox_with_timing_async.py index b9e5a8f9..32342f1c 100644 --- a/examples/02_create_sandbox_with_timing_async.py +++ b/examples/02_create_sandbox_with_timing_async.py @@ -146,12 +146,6 @@ async def main(run_long_tests=False): print(f" ✓ took {multi_check_duration:.1f}s") return 0 - except Exception as e: - print(f"\n✗ Error occurred: {e}") - import traceback - - traceback.print_exc() - return 1 finally: if sandbox: print(" → Deleting sandbox...") diff --git a/examples/03_basic_commands.py b/examples/03_basic_commands.py index 2ef07f61..de296604 100644 --- a/examples/03_basic_commands.py +++ b/examples/03_basic_commands.py @@ -49,9 +49,6 @@ def main(): assert result.exit_code != 0, "Expected non-zero exit code" return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: sandbox.delete() diff --git a/examples/03_basic_commands_async.py b/examples/03_basic_commands_async.py index e69bde63..adb45214 100644 --- a/examples/03_basic_commands_async.py +++ b/examples/03_basic_commands_async.py @@ -45,9 +45,6 @@ async def main(): print(result.stdout.strip()) return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: await sandbox.delete() diff --git a/examples/04_streaming_output.py b/examples/04_streaming_output.py index 09e21abf..528e5438 100644 --- a/examples/04_streaming_output.py +++ b/examples/04_streaming_output.py @@ -60,9 +60,6 @@ def main(): assert result.exit_code != 0, "Expected non-zero exit code" return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: sandbox.delete() diff --git a/examples/04_streaming_output_async.py b/examples/04_streaming_output_async.py index 2ce69628..0c366df3 100644 --- a/examples/04_streaming_output_async.py +++ b/examples/04_streaming_output_async.py @@ -54,9 +54,6 @@ async def main(): ) return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: await sandbox.delete() diff --git a/examples/05_environment_variables.py b/examples/05_environment_variables.py index 2ad9bb52..5ae711f4 100644 --- a/examples/05_environment_variables.py +++ b/examples/05_environment_variables.py @@ -68,9 +68,6 @@ def main(): print(f"Y={result.stdout.strip()}") return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: sandbox.delete() diff --git a/examples/05_environment_variables_async.py b/examples/05_environment_variables_async.py index ba23fa76..42cd146f 100644 --- a/examples/05_environment_variables_async.py +++ b/examples/05_environment_variables_async.py @@ -69,9 +69,6 @@ async def main(): print(f"Y={result.stdout.strip()}") return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: await sandbox.delete() diff --git a/examples/06_working_directory.py b/examples/06_working_directory.py index 9e6b7054..19026358 100644 --- a/examples/06_working_directory.py +++ b/examples/06_working_directory.py @@ -44,10 +44,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/06_working_directory_async.py b/examples/06_working_directory_async.py index 4346ae2c..b69e208d 100644 --- a/examples/06_working_directory_async.py +++ b/examples/06_working_directory_async.py @@ -46,10 +46,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/07_file_operations.py b/examples/07_file_operations.py index 91c23b66..4a2821b3 100644 --- a/examples/07_file_operations.py +++ b/examples/07_file_operations.py @@ -45,10 +45,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/07_file_operations_async.py b/examples/07_file_operations_async.py index 19a7b224..85efac88 100644 --- a/examples/07_file_operations_async.py +++ b/examples/07_file_operations_async.py @@ -47,10 +47,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/08_directory_operations.py b/examples/08_directory_operations.py index bf73a14c..bf0da934 100644 --- a/examples/08_directory_operations.py +++ b/examples/08_directory_operations.py @@ -52,10 +52,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/08_directory_operations_async.py b/examples/08_directory_operations_async.py index 5b9d7bd4..629ed1f5 100644 --- a/examples/08_directory_operations_async.py +++ b/examples/08_directory_operations_async.py @@ -54,10 +54,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/09_binary_files.py b/examples/09_binary_files.py index 84e9dd5a..773e60f1 100644 --- a/examples/09_binary_files.py +++ b/examples/09_binary_files.py @@ -40,10 +40,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/09_binary_files_async.py b/examples/09_binary_files_async.py index eff894ad..d7c3b96a 100644 --- a/examples/09_binary_files_async.py +++ b/examples/09_binary_files_async.py @@ -42,10 +42,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/10_batch_operations.py b/examples/10_batch_operations.py index d005c500..81e7eeee 100644 --- a/examples/10_batch_operations.py +++ b/examples/10_batch_operations.py @@ -56,10 +56,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/10_batch_operations_async.py b/examples/10_batch_operations_async.py index 2d6a8085..b3c94ba8 100644 --- a/examples/10_batch_operations_async.py +++ b/examples/10_batch_operations_async.py @@ -58,10 +58,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/11_upload_download.py b/examples/11_upload_download.py index b4241172..df51a9fb 100644 --- a/examples/11_upload_download.py +++ b/examples/11_upload_download.py @@ -59,10 +59,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/11_upload_download_async.py b/examples/11_upload_download_async.py index 3097dc7c..dbe8501e 100644 --- a/examples/11_upload_download_async.py +++ b/examples/11_upload_download_async.py @@ -61,10 +61,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/12_file_manipulation.py b/examples/12_file_manipulation.py index 294b636e..221f91f4 100644 --- a/examples/12_file_manipulation.py +++ b/examples/12_file_manipulation.py @@ -56,10 +56,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/12_file_manipulation_async.py b/examples/12_file_manipulation_async.py index 46751608..3baad34f 100644 --- a/examples/12_file_manipulation_async.py +++ b/examples/12_file_manipulation_async.py @@ -63,10 +63,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/13_background_processes.py b/examples/13_background_processes.py index 72dd6cd8..59299fb2 100755 --- a/examples/13_background_processes.py +++ b/examples/13_background_processes.py @@ -96,10 +96,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/13_background_processes_async.py b/examples/13_background_processes_async.py index b3db498f..44b2550b 100755 --- a/examples/13_background_processes_async.py +++ b/examples/13_background_processes_async.py @@ -97,10 +97,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/14_expose_port.py b/examples/14_expose_port.py index ac118680..4c9cf6b6 100755 --- a/examples/14_expose_port.py +++ b/examples/14_expose_port.py @@ -120,10 +120,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: sandbox.delete() diff --git a/examples/14_expose_port_async.py b/examples/14_expose_port_async.py index 502b159e..8612a573 100755 --- a/examples/14_expose_port_async.py +++ b/examples/14_expose_port_async.py @@ -124,10 +124,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: if sandbox: await sandbox.delete() diff --git a/examples/15_get_sandbox.py b/examples/15_get_sandbox.py index 57042d41..952cdffd 100644 --- a/examples/15_get_sandbox.py +++ b/examples/15_get_sandbox.py @@ -64,10 +64,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: # Cleanup: delete the sandbox (works from either instance) if original_sandbox: diff --git a/examples/15_get_sandbox_async.py b/examples/15_get_sandbox_async.py index 0d9f837b..ba5bfdc0 100644 --- a/examples/15_get_sandbox_async.py +++ b/examples/15_get_sandbox_async.py @@ -68,10 +68,6 @@ async def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: # Cleanup: delete the sandbox (works from either instance) if original_sandbox: diff --git a/examples/16_create_sandbox_with_auto_delete_simple.py b/examples/16_create_sandbox_with_auto_delete_simple.py index 13da686f..de9d35be 100644 --- a/examples/16_create_sandbox_with_auto_delete_simple.py +++ b/examples/16_create_sandbox_with_auto_delete_simple.py @@ -85,10 +85,6 @@ def main(): return 0 - except Exception as e: - print(f"\n✗ Error occurred: {e}") - return 1 - finally: if sandbox: print() diff --git a/examples/17_create_sandbox_with_auto_delete.py b/examples/17_create_sandbox_with_auto_delete.py index 88a0928e..0fb7d8ca 100644 --- a/examples/17_create_sandbox_with_auto_delete.py +++ b/examples/17_create_sandbox_with_auto_delete.py @@ -282,10 +282,6 @@ def main(): print(f" Expected: ~{idle_timeout_2 + delete_after_inactivity_2}s (idle + delete delay)") return 0 - except Exception as e: - print(f"\n✗ Error occurred: {e}") - return 1 - finally: # Clean up any sandboxes that weren't auto-deleted if sandbox1: diff --git a/examples/18_create_sandbox_with_existing_app.py b/examples/18_create_sandbox_with_existing_app.py index a27c8d97..c9bffffd 100644 --- a/examples/18_create_sandbox_with_existing_app.py +++ b/examples/18_create_sandbox_with_existing_app.py @@ -84,10 +84,6 @@ def main(): return 0 - except Exception as e: - print(f"Error: {e}") - return 1 - finally: # Clean up: delete the app (which will also delete the sandbox service) if app_id: diff --git a/examples/19_entrypoint_and_command.py b/examples/19_entrypoint_and_command.py index 6fd52b6b..9e0597f8 100644 --- a/examples/19_entrypoint_and_command.py +++ b/examples/19_entrypoint_and_command.py @@ -33,9 +33,6 @@ def main(): print(f" {result.stdout.strip()}") assert result.exit_code == 0, "Expected /tmp/command-was-here to exist" print(" OK: custom command created the file") - except Exception as e: - print(f" Error: {e}") - return 1 finally: if sandbox: sandbox.delete() @@ -58,9 +55,6 @@ def main(): print(f" Marker content: {content}") assert content == "yes", f"Expected 'yes', got '{content}'" print(" OK: python3 entrypoint created the marker file") - except Exception as e: - print(f" Error: {e}") - return 1 finally: if sandbox: sandbox.delete() diff --git a/examples/20_config_files.py b/examples/20_config_files.py index a7ed205f..81c58419 100644 --- a/examples/20_config_files.py +++ b/examples/20_config_files.py @@ -92,9 +92,6 @@ def main(): print(f"MY_SECRET={result.stdout.strip()}") return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: sandbox.delete() diff --git a/examples/20_config_files_async.py b/examples/20_config_files_async.py index 0f752332..67da92d9 100644 --- a/examples/20_config_files_async.py +++ b/examples/20_config_files_async.py @@ -93,9 +93,6 @@ async def main(): print(f"MY_SECRET={result.stdout.strip()}") return 0 - except Exception as e: - print(f"Error: {e}") - return 1 finally: if sandbox: await sandbox.delete()