error_is Function

private pure function error_is(self, code) result(matches)

Check if the error matches a specific error code

Usage: if (err%is(ERROR_IO)) then ! handle IO errors specifically end if

Type Bound

error_t

Arguments

Type IntentOptional Attributes Name
class(error_t), intent(in) :: self
integer(kind=default_int), intent(in) :: code

Return Value logical


Source Code

   pure function error_is(self, code) result(matches)
      !! Check if the error matches a specific error code
      !!
      !! Usage:
      !!   if (err%is(ERROR_IO)) then
      !!      ! handle IO errors specifically
      !!   end if
      class(error_t), intent(in) :: self
      integer(default_int), intent(in) :: code
      logical :: matches
      matches = (self%code == code)
   end function error_is