Throw an exception when a guard fails
Throw an exception when a guard fails
Answer
if (level < 0) { throw new IllegalArgumentException("level must be >= 0"); }
`throw` launches the exception object; the method stops immediately and the stack unwinds to the nearest matching handler.