Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325292 - Usability Issue - Improve Error Message when incorrect value set on property
Summary: Usability Issue - Improve Error Message when incorrect value set on property
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-14 16:32 EDT by Blaise Doughan CLA
Modified: 2022-06-09 10:25 EDT (History)
1 user (show)

See Also:


Attachments
Patch for providing better Error message. (7.33 KB, patch)
2010-09-20 03:04 EDT, Saurabh Arora CLA
blaise.doughan: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Blaise Doughan CLA 2010-09-14 16:32:39 EDT

    
Comment 1 Blaise Doughan CLA 2010-09-14 16:36:12 EDT
Some users are finding the following error message "unfriendly":

[EclipseLink-3001] (Eclipse Persistence Services - 1.1.1.v20090430-r4097): 
org.eclipse.persistence.exceptions.ConversionExceptionException Description: 
The object [45!@#6], of class [class java.lang.String], could not be 
converted to [class java.lang.Long].Internal Exception: 
java.lang.NumberFormatException: For input string: "45!@#6" 

We could enhance this error message to something like:

Exception [EclipseLink-45041] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): org.eclipse.persistence.exceptions.SDOException 
Exception Description: The value [invalidNumber] of class [class java.lang.String] is invalid for property [salary] of type [commonj.sdo#Int]. 
Internal Exception: Exception [EclipseLink-3001] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): 
org.eclipse.persistence.exceptions.ConversionException 
Exception Description: The object [invalidNumber], of class [class 
java.lang.String], could not be converted to [class java.lang.Integer]. 
Internal Exception: java.lang.NumberFormatException: For input string: 
"invalidNumber" 
at 
org.eclipse.persistence.exceptions.SDOException.invalidPropertyValue(SDOException.java:329) 
at 
org.eclipse.persistence.sdo.SDODataObject.convertValueAndSet(SDODataObject.jav 
a:2114) 
at 
org.eclipse.persistence.sdo.SDODataObject.setString(SDODataObject.java:1094) 
at demo.Demo.main(Demo.java:16) 
Caused by: Exception [EclipseLink-3001] (Eclipse Persistence Services - 
@VERSION@.@QUALIFIER@): 
org.eclipse.persistence.exceptions.ConversionException 
Exception Description: The object [invalidNumber], of class [class 
java.lang.String], could not be converted to [class java.lang.Integer]. 
Internal Exception: java.lang.NumberFormatException: For input string: 
"invalidNumber"
Comment 2 Saurabh Arora CLA 2010-09-20 03:04:27 EDT
Created attachment 179222 [details]
Patch for providing better Error message.
Comment 3 Blaise Doughan CLA 2010-10-05 16:35:20 EDT
Code checked into trunk at rev:  8319
Code reviewed by:  Blaise Doughan
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:25:32 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink