Turn a non zero iostat into an ERROR_IO carrying the raw value.
Every I/O statement in this module funnels its status through here so
that the failure message always names both the operation and the
iostat the runtime produced.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=default_int), | intent(in) | :: | ios | |||
| character(len=*), | intent(in) | :: | context | |||
| type(error_t), | intent(inout) | :: | err |
subroutine check_io(ios, context, err) !! Turn a non zero `iostat` into an `ERROR_IO` carrying the raw value. !! Every I/O statement in this module funnels its status through here so !! that the failure message always names both the operation and the !! `iostat` the runtime produced. integer(default_int), intent(in) :: ios character(len=*), intent(in) :: context type(error_t), intent(inout) :: err if (ios /= 0) call err%set(ERROR_IO, context//", iostat="//to_char(int(ios, int32))) end subroutine check_io