You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2008/01/23 15:20:01 UTC
svn commit: r614538 -
/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Author: fmeschbe
Date: Wed Jan 23 06:19:52 2008
New Revision: 614538
URL: http://svn.apache.org/viewvc?rev=614538&view=rev
Log:
SLING-186 Fix exception handling in JcrResourceResolver
Modified:
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java?rev=614538&r1=614537&r2=614538&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java (original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java Wed Jan 23 06:19:52 2008
@@ -42,6 +42,7 @@
import org.apache.jackrabbit.ocm.reflection.ReflectionUtils;
import org.apache.sling.api.SlingException;
import org.apache.sling.api.resource.NonExistingResource;
+import org.apache.sling.api.resource.QuerySyntaxException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceMetadata;
import org.apache.sling.api.resource.ResourceResolver;
@@ -166,7 +167,8 @@
language);
return new JcrNodeResourceIterator(this, res.getNodes());
} catch (javax.jcr.query.InvalidQueryException iqe) {
- throw new SlingException(iqe);
+ throw new QuerySyntaxException(iqe.getMessage(), query, language,
+ iqe);
} catch (RepositoryException re) {
throw new SlingException(re.getMessage(), re);
}
@@ -204,8 +206,11 @@
throw new UnsupportedOperationException("remove");
}
};
+ } catch (javax.jcr.query.InvalidQueryException iqe) {
+ throw new QuerySyntaxException(iqe.getMessage(), query, language,
+ iqe);
} catch (RepositoryException re) {
- throw new SlingException(re);
+ throw new SlingException(re.getMessage(), re);
}
}