To view the error type, first generate the error. This stores the error in the variable $error[0]. To view the error type use the following:
$error[0].exception.gettype().fullnameYou can use this with Try/Catch to catch different error messages and perform different actions based on the specific error type.
Try {
code to try
}
Catch [fullnameOfErrorType] {
stuff to do for that error type
}
Catch {
stuff to do for a non-defined error type
}
No comments:
Post a Comment