Results for “except”
Small, practical examples. Search by task or narrow things down below.
Observe an exception from an asynchronous task
C++: Calling get rethrows an exception captured by the future.
C++✓ Tested
Parse a complete integer without exceptions
C++: from_chars reports both an error code and the first unconsumed character.
C++✓ Tested
Parse a GUID without an exception
C#: TryParse reports malformed values with a boolean return.
C#✓ Tested
Perform cleanup even after an exception
C#: A finally block runs after a handled failure as well as after success.
C#✓ Tested
Raise and catch a domain-specific exception
Python: Give a validation failure its own exception type so callers can handle it narrowly.
Python✓ Tested
Run cleanup after a caught exception
PowerShell: Use finally for cleanup that must occur after either success or failure.
PowerShell✓ Tested
Run cleanup after a handled exception
Java: A finally block executes whether the protected operation succeeds or fails.
Java✓ Tested
Find rows in the first result but not the second
SQL: EXCEPT calculates a distinct result-set difference.
SQL✓ Tested
Find rows in the first result but not the second
SQL Server: EXCEPT calculates a distinct result-set difference.
SQL Server✓ Tested
Find rows in the first result but not the second
Postgres: EXCEPT calculates a distinct result-set difference.
Postgres✓ Tested
Find rows in the first result but not the second
SQLite: EXCEPT calculates a distinct result-set difference.
SQLite✓ Tested
Handle a terminating error
Catch conversion failures and produce a clear fallback.
try catch✓ Tested