For library/service code, define a small exception hierarchy rooted at a common base class. Callers can catch the base type or specific subclasses; you can add fields for structured context.
For any `AutoCloseable` (files, streams, DB connections, locks), declare it in `try(...)` and Java auto-calls `close()` even on exception. Replaces error-prone `try / finally` blocks.