json_failed Function

public function json_failed() result(failed)

Arguments

None

Return Value logical(kind=LK)

Description

Logical function to indicate if an exception has been thrown.

Example

    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

See also

Called By

proc~~json_failed~~CalledByGraph proc~json_failed json_failed proc~test_7 test_7 proc~test_7->proc~json_failed proc~test_9 test_9 proc~test_9->proc~json_failed proc~test_2 test_2 proc~test_2->proc~json_failed proc~add_variables_to_input add_variables_to_input proc~test_2->proc~add_variables_to_input none~check_errors check_errors none~check_errors->proc~json_failed proc~test_3 test_3 proc~test_3->proc~json_failed proc~test_8 test_8 proc~test_8->proc~json_failed proc~test_13 test_13 proc~test_13->proc~json_failed proc~add_variables_to_input->proc~json_failed proc~test_1 test_1 proc~test_1->proc~json_failed proc~test_10 test_10 proc~test_10->proc~json_failed proc~test_5 test_5 proc~test_5->proc~json_failed proc~test_14 test_14 proc~test_14->proc~json_failed proc~test_6 test_6 proc~test_6->proc~json_failed proc~test_11 test_11 proc~test_11->proc~json_failed proc~test_4 test_4 proc~test_4->proc~json_failed program~jf_test_7 jf_test_7 program~jf_test_7->proc~test_7 program~jf_test_9 jf_test_9 program~jf_test_9->proc~test_9 program~jf_test_2 jf_test_2 program~jf_test_2->proc~test_2 proc~test_12 test_12 proc~test_12->none~check_errors program~jf_test_12 jf_test_12 program~jf_test_12->proc~test_12 program~jf_test_3 jf_test_3 program~jf_test_3->proc~test_3 program~jf_test_8 jf_test_8 program~jf_test_8->proc~test_8 program~jf_test_13 jf_test_13 program~jf_test_13->proc~test_13 program~jf_test_1 jf_test_1 program~jf_test_1->proc~test_1 program~jf_test_10 jf_test_10 program~jf_test_10->proc~test_10 program~jf_test_5 jf_test_5 program~jf_test_5->proc~test_5 program~jf_test_14 jf_test_14 program~jf_test_14->proc~test_14 program~jf_test_6 jf_test_6 program~jf_test_6->proc~test_6 program~jf_test_11 jf_test_11 program~jf_test_11->proc~test_11 program~jf_test_4 jf_test_4 program~jf_test_4->proc~test_4
Help

Source Code

    function json_failed() result(failed)

    implicit none

    logical(LK) :: failed

    failed = exception_thrown

    end function json_failed