Skip to content

Commit

Permalink
dom: Report errors from the sax's open_xml_file
Browse files Browse the repository at this point in the history
If the iostat argument isn't passed to the dom parsefile
function report details of exceptions generated in the
sax layer's open_xml_file. If iostat is used, this will
be set to SAX_OPEN_ERROR.
  • Loading branch information
andreww committed Nov 17, 2010
1 parent 8ad0033 commit c799cb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dom/m_dom_parse.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module m_dom_parse
use m_common_attrs, only: hasKey, getValue, getIndex, getIsId, getBase, &
add_item_to_dict
use m_common_entities, only: entity_t, size, getEntityByIndex
use m_common_error, only: FoX_error
use m_common_error, only: FoX_error, in_error
use m_common_struct, only: xml_doc_state
use FoX_common, only: dictionary_t, getLength
use FoX_common, only: getQName, getValue, getURI, isSpecified
Expand Down Expand Up @@ -535,6 +535,8 @@ function parsefile(filename, configuration, iostat, ex)
if (present(iostat)) then
iostat = iostat_
if (iostat/=0) return
elseif (in_error(fxml%fx%error_stack)) then
call FoX_error(str_vs(fxml%fx%error_stack%stack(1)%msg))
elseif (iostat_/=0) then
call FoX_error("Cannot open file")
endif
Expand Down
4 changes: 3 additions & 1 deletion dom/m_dom_parse.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module m_dom_parse
use m_common_attrs, only: hasKey, getValue, getIndex, getIsId, getBase, &
add_item_to_dict
use m_common_entities, only: entity_t, size, getEntityByIndex
use m_common_error, only: FoX_error
use m_common_error, only: FoX_error, in_error
use m_common_struct, only: xml_doc_state
use FoX_common, only: dictionary_t, getLength
use FoX_common, only: getQName, getValue, getURI, isSpecified
Expand Down Expand Up @@ -529,6 +529,8 @@ contains
if (present(iostat)) then
iostat = iostat_
if (iostat/=0) return
elseif (in_error(fxml%fx%error_stack)) then
call FoX_error(str_vs(fxml%fx%error_stack%stack(1)%msg))
elseif (iostat_/=0) then
call FoX_error("Cannot open file")
endif
Expand Down

0 comments on commit c799cb6

Please sign in to comment.