• 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: Exception not propagated on "input to long"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exception not propagated on "input to long"


  • Subject: Re: Exception not propagated on "input to long"
  • From: George Domurot <email@hidden>
  • Date: Wed, 12 Jan 2005 07:56:16 -0800

Take a look at the API reference for WOComponent.validationFailedWithException

On Jan 12, 2005, at 3:20 AM, Wolfram Stebel wrote:

Hi all,

in the code below, ec.saveChanges () with a input to long for the database
field does not propagate the exception.



public WOComponent saveTask()
{
try
{
if ( ec.hasChanges () )
{
theTask.setUpdater ( session.getThePerson () );
theTask.setUpd_date ( DateHelper.getNSTimestampForNow () );
ec.saveChanges ();
}
hasErrors = false;
return returnPage();
}
catch ( NSValidation.ValidationException exception )
{
hasErrors = true;
errors = exception.getMessage ();
}
return null;
}



But the trace shows the exception:

[2005-01-12 12:10:30 CET] <WorkerThread12>
com.webobjects.foundation.NSValidation$ValidationException: The task_title
property of Task exceeds maximum length of 128 characters
at
com.webobjects.eoaccess.EOAttribute.validateValue(EOAttribute.java: 2381)
at
com.webobjects.eoaccess.EOEntityClassDescription.validateValueForKey(EO Entit
yClassDescription.java:439)
...
..
.


The data is not saved!
I dont come into the catch branch, i.e. no user feedback!

The problem is, that validateOnSave is called only in ec.saveChanges (), not
before, so i can not validate the input length.
Calling validateForSave explicit for theTask is not to great of a solution.


Any clever idea?
Should i just remove the call to hasChanges ()? I thought it is an
performance improvement...

Wolfram Stebel


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


This email sent to email@hidden

_______________________________________________ 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: Exception not propagated on "input to long"
      • From: "Arturo Perez" <email@hidden>
References: 
 >Exception not propagated on "input to long" (From: Wolfram Stebel <email@hidden>)

  • Prev by Date: Re: [ANN] woproject 1.1.0.102 RC 2
  • Next by Date: Re: Exception not propagated on "input to long"
  • Previous by thread: Exception not propagated on "input to long"
  • Next by thread: Re: Exception not propagated on "input to long"
  • Index(es):
    • Date
    • Thread