Push msg to the error ring, log it (unchanged behaviour), then
either set ierr = code and return (caller must return
immediately after this call) or error stop msg when ierr is
absent. See the module docstring for the full contract.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | msg | |||
| integer, | intent(out), | optional | :: | ierr | ||
| integer, | intent(in) | :: | code |
subroutine fail(msg, ierr, code) !! Push `msg` to the error ring, log it (unchanged behaviour), then !! either set `ierr = code` and return (caller must `return` !! immediately after this call) or `error stop msg` when `ierr` is !! absent. See the module docstring for the full contract. character(len=*), intent(in) :: msg integer, intent(out), optional :: ierr integer, intent(in) :: code call error_ring_push(msg) call logger%error(msg) if (present(ierr)) then ierr = code else error stop msg end if end subroutine fail