PowerBuilder · Exception
What does Exception Base Class (Checked Exceptions) mean in PowerBuilder?
Exception is the root ancestor for user-defined, checked exception types in PowerBuilder's TRY/CATCH model, distinct from the unchecked RuntimeError branch. Any custom exception object inherited from Exception must be either caught inside the routine that throws it or declared in that routine's signature with a THROWS clause, or the compiler flags it.
Exception is the root ancestor for user-defined, checked exception types in PowerBuilder's TRY/CATCH model, distinct from the unchecked RuntimeError branch. Any custom exception object inherited from Exception must be either caught inside the routine that throws it or declared in that routine's signature with a THROWS clause, or the compiler flags it.
Inherit application-specific exception objects from Exception (not RuntimeError) so the compiler enforces that callers handle them, and set a clear message via SetMessage() in the constructor for GetMessage() to surface later. Add THROWS clauses to function/event prototypes that can propagate the exception instead of catching it locally.