Re: try catch doesn't catch my exception...
Re: try catch doesn't catch my exception...
- Subject: Re: try catch doesn't catch my exception...
- From: Wolfram Stebel <email@hidden>
- Date: Mon, 10 Oct 2005 13:28:42 +0200
Am 10.10.2005 11:11 Uhr schrieb "Amedeo Mantica" unter
<email@hidden>:
> Hi,
> I have the following code
>
>
> try
> {
> System.out.println("!!!!!!!!!!!Saving changes");
> ec.saveChanges();
> }
> catch (NSValidation.ValidationException exception)
> {
> // caught an exception on save.
> errorsPresent = true;
> errorString = (String) exception.key();
> System.out.println("Errors present"+errorString);
> return null;
> }
>
>
>
> ec is my EditiingContext
>
> I got execption in the run log...
>
> [2005-10-10 11:05:04 CEST] <WorkerThread0> Validation failed on an
> object [null] with keypath = theLocale.nomeCognome and exception: The
> nomeCognome property of locali is not allowed to be null.
> !!!!!!!!!!!Saving changes
>
> but the catch code is totally ignored! :(
>
> anyone can help?
use the method below in your form. it will catch the exceptions that occure
before saveChanges(). eo validates the data from the form against the data
model, i.e. for matching field types and length, and invokes this method on
error:
public void validationFailedWithException ( Throwable t, Object value,
String keyPath )
{
value );
}
hth
Dipl. Inform. Wolfram Stebel, bugs&errors
Flutgrabenstr. 19, 35576 Wetzlar
Tel. 06441/47633
Mailto:email@hidden
Web: www.bugs-and-errors.de
Wolfram
_______________________________________________
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