Set an error with code and message Resets the stack trace
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(error_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | code | |||
| character(len=*), | intent(in) | :: | message |
pure subroutine error_set(this, code, message) !! Set an error with code and message !! Resets the stack trace class(error_t), intent(inout) :: this integer, intent(in) :: code character(len=*), intent(in) :: message this%code = code this%message = trim(message) this%stack_depth = 0 ! Reset stack when setting new error end subroutine error_set