Re: [xwiki-notifications] r8424 - xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/packaging

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [xwiki-notifications] r8424 - xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/packaging

vmassol
Administrator

On Mar 12, 2008, at 5:21 AM, sdumitriu (SVN) wrote:

> Author: sdumitriu
> Date: 2008-03-12 05:21:37 +0100 (Wed, 12 Mar 2008)
> New Revision: 8424
>
> Modified:
>   xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
> plugin/packaging/Package.java
> Log:
> XWIKI-2200: Import of "homemade" xar doesn't function
> Fixed.
>
>
> Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/
> xwiki/plugin/packaging/Package.java
> ===================================================================
> --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
> plugin/packaging/Package.java 2008-03-12 03:55:35 UTC (rev 8423)
> +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
> plugin/packaging/Package.java 2008-03-12 04:21:37 UTC (rev 8424)
> @@ -385,8 +385,14 @@
>                     || (entry.getName().indexOf("META-INF") != -1)) {
>                     continue;
>                 } else {
> -                    XWikiDocument doc =
> -                        
> readFromXML(readByteArrayFromInputStream(zis, entry.getSize()));
> +                    XWikiDocument doc = null;
> +                    try {
> +                        doc =  
> readFromXML(readByteArrayFromInputStream(zis, entry.getSize()));
> +                    } catch (Exception ex) {
> +                        log.warn("Failed to parse document [" +  
> entry.getName() + "] from XML");

We need to also add ex.getMesage() to the log output in order to  
better diagnose errors when they appear.
Also the message need to be more explicit. We need to say that we're  
ignoring the doc and that it won't be imported.

Thanks
-Vincent

_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [xwiki-notifications] r8424 - xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/packaging

ebullient
On Wed, Mar 12, 2008 at 4:10 AM, Vincent Massol <[hidden email]> wrote:

>
>  > ===================================================================
>  > --- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
>  > plugin/packaging/Package.java 2008-03-12 03:55:35 UTC (rev 8423)
>  > +++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
>  > plugin/packaging/Package.java 2008-03-12 04:21:37 UTC (rev 8424)
>  > @@ -385,8 +385,14 @@
>  >                     || (entry.getName().indexOf("META-INF") != -1)) {
>  >                     continue;
>  >                 } else {
>  > -                    XWikiDocument doc =
>  > -
>  > readFromXML(readByteArrayFromInputStream(zis, entry.getSize()));
>  > +                    XWikiDocument doc = null;
>  > +                    try {
>  > +                        doc =
>  > readFromXML(readByteArrayFromInputStream(zis, entry.getSize()));
>  > +                    } catch (Exception ex) {
>  > +                        log.warn("Failed to parse document [" +
>  > entry.getName() + "] from XML");
>
>  We need to also add ex.getMesage() to the log output in order to
>  better diagnose errors when they appear.
>  Also the message need to be more explicit. We need to say that we're
>  ignoring the doc and that it won't be imported.
>
>  Thanks
>  -Vincent
>

Yes, especially something that says which document it is (which it
looks like you're doing). It's the biggest pain in the butt on the
back-level version I'm on to try to figure out which of the gazillions
of documents in the package is badly formed...

--
'Waste of a good apple' -Samwise Gamgee
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs