# PetscAbortErrorHandler
Error handler that calls abort on error. This routine is very useful when running in the debugger, because the user can look directly at the stack frames and the variables. 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscAbortErrorHandler(MPI_Comm comm, int line, const char *fun, const char *file, PetscErrorCode n, PetscErrorType p, const char *mess, void *ctx)
```
Not Collective


## Input Parameters

- ***comm -*** communicator over which error occurred
- ***line -*** the line number of the error (indicated by __LINE__)
- ***file -*** the file in which the error was detected (indicated by __FILE__)
- ***mess -*** an error text string, usually just printed to the screen
- ***n -*** the generic error number
- ***p -*** specific error number
- ***ctx -*** error handler context



## Options Database Keys

- ***-on_error_abort -*** Activates aborting when an error is encountered
- ***-start_in_debugger [noxterm,dbx,xxgdb]  [-*** display name] - Starts all
processes in the debugger and uses PetscAbortErrorHandler().  By default the
debugger is gdb; alternatives are dbx and xxgdb.





## Notes
Ussers do not directly employ this routine

Use `PetscPushErrorHandler()` to set the desired error handler.  The
currently available PETSc error handlers include `PetscTraceBackErrorHandler()`,
`PetscAttachDebuggerErrorHandler()`, and `PetscAbortErrorHandler()`.


## See Also
 `PetscError()`, `PetscPushErrorHandler()`, `PetscPopErrorHander()`, `PetscTraceBackErrorHandler()`,
`PetscAttachDebuggerErrorHandler()`, `PetscMPIAbortErrorHandler()`, `PetscReturnErrorHandler()`, `PetscEmacsClientErrorHandler()`

## Level
developer

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


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


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