in the sense of REST I would support mike's objection. But maybe the "by design"-explanantion can make me/us rethink...?
> -----Original Message----- > From: Michael Yin [mailto:yincr...@gmail.com] > Sent: Wednesday, March 31, 2010 3:07 AM > To: users@sling.apache.org > Subject: Re: SlingPostServlet saves operations that throw an error in > the log but return 200 responses > > > I would argue that errors should be given an appropriate > response. Most of > the other actions that I've seen return appropriate error > responses, such as > doing xpath searches with improper syntax returns a 500 or > when a resource > isn't found, returning a 404. You can still output HTML with a non-200 > response. Otherwise it just seems inconsistent. > > -mike > > On Tue, Mar 30, 2010 at 7:34 PM, Justin Edelson > <justinedel...@gmail.com>wrote: > > > Michael- > > A description of this failure should have been contained in the HTML > > response to your POST. The status code is not particularly > > informative; you must parse the (X)HTML returned by the > Post Servlet. > > This is by design. > > > > Justin > > > > On Mar 30, 2010, at 5:31 PM, Michael Yin <yincr...@gmail.com> wrote: > > > > > I'm on a fairly recent trunk build, and when I do save operations > > > with the > > > sling post servlet, I'm getting OK responses back from > the servlet > > > but I > > > see errors in the sling log, and trying to retrieve the node again > > > shows > > > that the changes did not happen. > > > > > > Here is one of the stack traces in the log > > > > > > org.apache.sling.servlets.post.impl.operations.ModifyOperation > > > Exception > > > during response processing. > > > javax.jcr.nodetype.ConstraintViolationException: > > > Unable to perform operation. Node is protected. > > > at > > > org.apache.jackrabbit.core.ItemValidator.checkCondition > > > (ItemValidator.java:303) > > > at > > > org.apache.jackrabbit.core.ItemValidator.checkModify > > > (ItemValidator.java:277) > > > at > > > org.apache.jackrabbit.core.PropertyImpl.checkSetValue > > > (PropertyImpl.java:235) > > > at org.apache.jackrabbit.core.PropertyImpl.setValue > > > (PropertyImpl.java:690) > > > at > org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2418) > > > at > org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:1560) > > > at > org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2139) > > > at > > > > > > org.apache.sling.servlets.post.impl.helper.SlingPropertyValueH > andler.setPropertyAsIs( > > > SlingPropertyValueHandler.java:278) > > > at > > > > > > org.apache.sling.servlets.post.impl.helper.SlingPropertyValueH > andler.setProperty( > > > SlingPropertyValueHandler.java:106) > > > at > > > > > > org.apache.sling.servlets.post.impl.operations.ModifyOperation > .writeContent( > > > ModifyOperation.java:432) > > > at > > > > org.apache.sling.servlets.post.impl.operations.ModifyOperation.doRun > > > (ModifyOperation.java:100) > > > at > > > org.apache.sling.servlets.post.AbstractSlingPostOperation.run > > > (AbstractSlingPostOperation.java:87) > > > at > > > org.apache.sling.servlets.post.impl.SlingPostServlet.doPost > > > (SlingPostServlet.java:178) > > > > > > > > > -mike > > >