make_error Subroutine

public subroutine make_error(error, message, stat)

Create new error message

Arguments

Type IntentOptional Attributes Name
type(toml_error), intent(out), allocatable :: error

Error report

character(kind=tfc, len=*), intent(in) :: message

Message for the error

integer, intent(in), optional :: stat

Status code


Source Code

subroutine make_error(error, message, stat)
   !> Error report
   type(toml_error), allocatable, intent(out) :: error
   !> Message for the error
   character(*, tfc), intent(in) :: message
   !> Status code
   integer, intent(in), optional :: stat

   allocate(error)
   error%message = message
   if (present(stat)) then
      error%stat = stat
   else
      error%stat = toml_stat%fatal
   end if
end subroutine make_error