PETSc version 3.17.4
Fix/Edit manual page

# SETERRQ

Macro to be called when an error has been detected,

### Synopsis

    #include <petscsys.h>
    PetscErrorCode SETERRQ(MPI_Comm comm,PetscErrorCode ierr,char *message,...)

Collective

### Input Parameters

| comm | - A communicator, use PETSC_COMM_SELF unless you know all ranks of another communicator will detect the error
| ierr | - nonzero error code, see the list of standard error codes in include/petscerror.h
| message | - error message

### Notes

Once the error handler is called the calling function is then returned from with the given error code.

Experienced users can set the error handler with PetscPushErrorHandler().

### Fortran Notes

SETERRQ() may be called from Fortran subroutines but SETERRA() must be called from the Fortran main program.

### See Also

PetscCheck(), PetscAssert(), PetscTraceBackErrorHandler(), PetscPushErrorHandler(),
PetscError(), PetscCall(), CHKMEMQ, CHKERRA(), PetscCallMPI()

### Level

beginner

### Location

src/sys/error/../../../include/petscerror.h

### Examples

src/vec/vec/tutorials/ex10.c.html
src/vec/vec/tutorials/ex19.c.html
src/dm/impls/plex/tutorials/ex11.c.html
src/dm/impls/stag/tutorials/ex6.c.html
src/dm/tutorials/ex3.c.html
src/dm/tutorials/swarm_ex1.c.html
src/dm/field/tutorials/ex1.c.html
src/ksp/ksp/tutorials/ex27.c.html
src/ksp/ksp/tutorials/ex32.c.html
src/ksp/ksp/tutorials/ex42.c.html
src/ksp/ksp/tutorials/ex43.c.html
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages