• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Aggregating ValidationExceptions in validateForSave()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aggregating ValidationExceptions in validateForSave()


  • Subject: Re: Aggregating ValidationExceptions in validateForSave()
  • From: Paul Hoadley <email@hidden>
  • Date: Wed, 18 Feb 2015 16:25:07 +1030

I'm just not going to let this go.

On 15 Jan 2015, at 4:53 am, Chuck Hill <email@hidden> wrote:

IIRC, it should work like the first example, but it is possible that some code is creating the thrown exception incorrectly.  The last code example is probably safe.

I'm still not quite there with this—I'm getting exceptions "dropped" in practice.  (I know they're being created, but by the time things get back to the view layer, I'm seeing fewer validation error messages than expected.)  I managed to dig up a thread about as old as the one previously quoted:

https://groups.yahoo.com/neo/groups/webobjects/conversations/messages/62722

I think this is very close to what I want, but, and I can hardly believe I'm typing this... is there a bug in either or both of ValidationException.aggregateExceptionWithExceptions() or ValidationException.additionalExceptions()?  If I call aggregateExceptionWithExceptions() on an array with two ValidationExceptions v1 and v2 where both v1.additionalExceptions() and v2.additionalExceptions() returns null (that is, there's no nesting), it returns what I'd expect, which is basically v1 with v1.additionalExceptions() returning v2.  That's great.  Call that ag1.

If I put ag1 and a third, non-nested ValidationException v3 in an array together, and call aggregateExceptionWithExceptions() on that array, the result is indistinguishable from ag1 itself.  I just get v2 nested in v1, and v3 is apparently ignored.  However, calling ag2.userInfo().valueForKey(ValidationException.AdditionalExceptionsKey) (which is deprecated in two places—userInfo() and AdditionalExceptionsKey), I can see v3 in the result!

I can provide code if someone wants to see it, but I thought it more likely that this is a known problem, or my expectations are wrong, and someone might just be able to set me straight.  Any thoughts on this Chuck?


-- 
Paul Hoadley
http://logicsquad.net/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Aggregating ValidationExceptions in validateForSave()
      • From: Paul Hoadley <email@hidden>
  • Prev by Date: Re: relationship value different in another EC (was: ordered and filtered fault efficiency)
  • Next by Date: WOLips Copy & Paste issue on Yosemite
  • Previous by thread: Re: BuiltWith February 2015 - New sites found using WebObjects that we added over the past month.
  • Next by thread: Re: Aggregating ValidationExceptions in validateForSave()
  • Index(es):
    • Date
    • Thread