[hibernate-issues] [Hibernate-JIRA] Commented: (HV-24) Improve the default message of InvalidStateException

Tomasz Bartczak (JIRA) noreply at atlassian.com
Tue Jul 14 05:41:13 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33603#action_33603 ] 

Tomasz Bartczak commented on HV-24:
-----------------------------------

This is a good idea, as any exception should mark every known symptoms in its detail message.

And it's so simple and not harming anybody while helping so much in knowing the exception cause:
It would be jest one line change in the super() in InvalidStateException constructor:

	public InvalidStateException(InvalidValue[] invalidValues, String className) {
		super( "validation failed for: " + className + " " + Arrays.toString(invalidValues));  //changed
		this.invalidValues = invalidValues;
	}

I've already made this change in my working jar and it helps a lot, but that would be great to see it in the codebase.

> Improve the default message of InvalidStateException
> ----------------------------------------------------
>
>                 Key: HV-24
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-24
>             Project: Hibernate Validator
>          Issue Type: Improvement
>          Components: legacy
>    Affects Versions: 3.0.0.ga
>         Environment: Any
>            Reporter: Mike Quilleash
>
> Doing a printStackTrace on InvalidStateException does not give the actual invalid values anywhere.  Would greatly improving debugging speed if this was included by default as often this indicates a programming error.  Currently I have to run the code again and debug the right place to find out what the InvalidValues are.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list