Skip to content

Commit

Permalink
Merge bug/REL1_6_STABLE/issue481 into REL1_6_STABLE
Browse files Browse the repository at this point in the history
Merges PR #482.
  • Loading branch information
jcflack committed Apr 1, 2024
2 parents 38e46db + e77d11a commit edc958b
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions pljava/src/main/java/org/postgresql/pljava/jdbc/SQLXMLImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -3933,6 +3933,10 @@ static void saxCopy(SAXSource sxs, SAXResult sxr) throws SQLException
SAX2PROPERTY.LEXICAL_HANDLER.propertyUri(), lh);
xr.parse(sxs.getInputSource());
}
/*
* If changing these wrapping conventions, change them also in
* AdjustingDOMSource.get()
*/
catch ( SAXException e )
{
throw new SQLDataException(e.getMessage(), "22000", e);
Expand Down Expand Up @@ -5555,10 +5559,21 @@ public DOMSource get() throws SQLException
}

Exception e = exceptions();
if ( null != e )
throw normalizedException(e);

return ds;
if ( null == e )
return ds;

/*
* If changing these wrapping conventions, change them also in
* XMLCopier.saxCopy()
*/
if ( e instanceof SAXException )
throw new SQLDataException(e.getMessage(), "22000", e);

if ( e instanceof IOException )
throw new SQLException(e.getMessage(), "58030", e);

throw normalizedException(e);
}

@Override
Expand Down

0 comments on commit edc958b

Please sign in to comment.