• 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: cannot catch NSValidation.ValidationException
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cannot catch NSValidation.ValidationException


  • Subject: Re: cannot catch NSValidation.ValidationException
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 9 Mar 2005 11:33:53 -0800


On Mar 9, 2005, at 2:37 AM, Dumitru Husleag wrote:

   Hello everybody,

   I have validateKey() methods in an EnterpriseObject. The code gets
caled (I see in the console the ERXLogger message : "Validation failed
on an object ...").
   My code looks like this:
<code>
        try{
            ec.saveChanges();
        }
        catch(Throwable x){
            setErrorMessage(x.getMessage());
        }
</code>

The problem is I do not get an exception here.

No, you don't. The validation happens during the takeValues phase. The exceptions are passed to your page in the WOComponent method:


public void validationFailedWithException(Throwable t,
Object value,
String keyPath)
Called when an Enterprise Object or formatter failed validation during an assignment. The default implementation ignores the error. Subclassers can override to record the error and possibly return a different page for the current actio



Chuck


--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects




_______________________________________________
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


References: 
 >cannot catch NSValidation.ValidationException (From: Dumitru Husleag <email@hidden>)

  • Prev by Date: Tomcat and WO System Properties...
  • Next by Date: EOM datatypes for Imperial values
  • Previous by thread: cannot catch NSValidation.ValidationException
  • Next by thread: Run session cancelled: No launchable executable to run
  • Index(es):
    • Date
    • Thread