Logical function to indicate if an exception has been thrown.
type(json_file) :: json logical :: status_ok character(len=:),allocatable :: error_msg call json%load_file(filename='myfile.json') if (json_failed()) then call json_check_for_errors(status_ok, error_msg) write(*,*) 'Error: '//error_msg call json_clear_exceptions() call json%destroy() end if
function json_failed() result(failed)
implicit none
logical(LK) :: failed
failed = exception_thrown
end function json_failed