catch
$try = $try->catch('Error::HTTP400', fun ($caught) {
# do something
});
$try = $try->catch('Error::HTTP401', fun ($caught) {
# do something
});
The catch method takes a package or ref name, and when triggered checks whether the captured exception is of the type specified and if so executes the given callback.
catch(Str $isa, Str | CodeRef $callback) : Any
method
5 POD Errors
The following errors were encountered while parsing the POD:
- Around line 10:
Unknown directive: =name
- Around line 14:
Unknown directive: =usage
- Around line 24:
Unknown directive: =description
- Around line 30:
Unknown directive: =signature
- Around line 34:
Unknown directive: =type