:orphan:
# PetscWaitOnError
If an error is detected and the process would normally exit the main program with `MPI_Abort()` sleep instead of exiting. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscWaitOnError(void)
```
Not Collective




## Note
When -start_in_debugger -debugger_ranks x,y,z is used this prevents the processes NOT listed in x,y,z from calling MPI_Abort and
killing the user's debugging sessions.


## See Also
 `PetscSetDebugger()`, `PetscAttachDebugger()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/error/adebug.c.html#PetscWaitOnError">src/sys/error/adebug.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/error/adebug.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
