mrglavas 2004/05/14 12:52:12 Modified: java/src/org/apache/xml/serialize DOMSerializerImpl.java Log: If an LSException was thrown to the LSSerializer rethrow it. Revision Changes Path 1.24 +16 -6 xml-xerces/java/src/org/apache/xml/serialize/DOMSerializerImpl.java Index: DOMSerializerImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/DOMSerializerImpl.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- DOMSerializerImpl.java 14 May 2004 19:37:53 -0000 1.23 +++ DOMSerializerImpl.java 14 May 2004 19:52:12 -0000 1.24 @@ -499,7 +499,8 @@ ser.serialize((Element)wnode); else return null; - } catch (LSException lse){ + } catch (LSException lse) { + // Rethrow LSException. throw lse; } catch (RuntimeException e) { if (e == DOMNormalizer.abort){ @@ -508,10 +509,13 @@ } throw new LSException(LSException.SERIALIZE_ERR, e.toString()); } catch (IOException ioe) { - String msg = DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "STRING_TOO_LONG", - new Object[] { ioe.getMessage()}); + // REVISIT: A generic IOException doesn't provide enough information + // to determine that the serialized document is too large to fit + // into a string. This could have thrown for some other reason. -- mrglavas + String msg = DOMMessageFormatter.formatMessage( + DOMMessageFormatter.DOM_DOMAIN, + "STRING_TOO_LONG", + new Object[] { ioe.getMessage()}); throw new DOMException(DOMException.DOMSTRING_SIZE_ERR,msg); } return destination.toString(); @@ -787,6 +791,9 @@ DOMMessageFormatter.SERIALIZER_DOMAIN, "unsupported-encoding", null)); //return false; + } catch (LSException lse) { + // Rethrow LSException. + throw lse; } catch (RuntimeException e) { if (e == DOMNormalizer.abort){ // stopped at user request @@ -937,6 +944,9 @@ ser.serialize((Element) node); else return false; + } catch (LSException lse) { + // Rethrow LSException. + throw lse; } catch (RuntimeException e) { if (e == DOMNormalizer.abort){ // stopped at user request
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]