# PetscExceptionTry1

Runs the routine, causing a particular error code to be treated as an exception, rather than an error. That is if that error code is treated the program returns to this level, but does not call the error handlers Not Collective

### Synopsis

    PetscExceptionTry1(PetscErrorCode routine(....),PetscErrorCode);

### Notes

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

Note: In general, the outer most try on an exception is the one that will be caught (that is trys down in PETSc code will not usually handle an exception that was issued above). See SNESSolve() for an example of how the local try is ignored if a higher (in the stack) one is also in effect.

### See Also

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

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

### Examples

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