# PetscExceptionCaught

Indicates if a specific exception zierr was caught. Not Collective

### Synopsis

    PetscTruth PetscExceptionCaught(PetscErrorCode xierr,PetscErrorCode zierr);

### Input Parameters

+ xierr - error code returned from PetscExceptionTry1() - zierr - error code you want it to be

### Notes

PETSc must not be configured using the option --with-errorchecking=0 for this to work

Use PetscExceptionValue() to see if the current error code is one that has been "tried"

### See Also

PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), SETERRQ(), CHKMEMQ, SETERRQ1(), SETERRQ2(), SETERRQ3(),
CHKERRQ(), PetscExceptionTry1(), PetscExceptionValue()

Level:advanced
Location:src/sys/error/../../../include/petscerror.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex10.c.html