Groovy errors and exceptions
Handle invalid entries, missing records, and interrupted work. Follow each failure from the input that triggers it to a response the user can act on.
Input and validation
- DateTimeParseExceptionCheck a delivery date entered on a form
- IllegalArgumentExceptionReject an empty ticket order
- NumberFormatExceptionReject a mistyped order quantity
- PatternSyntaxExceptionValidate a saved product search
- Safe navigation and ElvisPrint a label when the phone number is missing
- instanceof type checkCheck the type of an imported fare
State and collections
- ConcurrentModificationExceptionRemove an expired pass during inspection
- List.get and IndexOutOfBoundsExceptionFind a seat after the coach changes
- intdiv and ArithmeticExceptionSplit an equipment fee across a class
Files and streams
- EOFExceptionRead a stock count from a short record
- FileAlreadyExistsExceptionSave a report without replacing the first copy
- IOException on a closed readerRead from a finished receipt import
- NoSuchFileExceptionRecover when a receipt is missing
Jobs and runtime
- CancellationExceptionCollect a cancelled print job
- ClassNotFoundExceptionLoad an optional invoice exporter
- ExecutionExceptionFind the reason a background import failed
- InterruptedExceptionStop waiting when a shift ends
- TimeoutExceptionLimit the wait for a shipping quote