Bug 1056578 - Improve exception information when incorrect format of list or object was used
Summary: Improve exception information when incorrect format of list or object was used
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Domain Management
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: DR1
: EAP 6.4.0
Assignee: Brian Stansberry
QA Contact: Petr Kremensky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-22 13:52 UTC by Ondrej Chaloupka
Modified: 2019-08-19 12:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-19 12:38:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DMR-11 0 Major Pull Request Sent More useful conversion failure messages 2017-04-19 10:44:09 UTC
Red Hat Issue Tracker WFCORE-7 0 Major Resolved MapAttributeDefinition and ListAttributeDefinition incorrectly assume valid types in convertParameterExpressions 2017-04-19 10:44:09 UTC

Description Ondrej Chaloupka 2014-01-22 13:52:50 UTC
Currently when you use in CLI some command working with LIST or OBJECT and you does not specify that it should be LIST {[]} or OBJECT {} you will general exception which talks about nothing:

"failure-description" => "JBAS014749: Operation handler failed: null",

Please, improve the message for user would know understand that he used incorrect value type.

E.g. 
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=valid-connection-checker-properties, value=1)

should inform the user that incorrect data type was used and OBJECT is needed to be used.

The better message should be used when user uses incorrect syntax, like:
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=valid-connection-checker-properties, value={abc:abc})
instead of
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=valid-connection-checker-properties, value={abc=abc})

The user should get information that incorrect syntax was used and not just info that there is some NullPointerException.

There is quite informative message when you use LIST instead of OBJECT
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=valid-connection-checker-properties, value={[a=a]})
you could see
"failure-description" => "JBAS014688: Wrong type for valid-connection-checker-properties. Expected [OBJECT] but was LIST"

Just I would have a proposal to use text which lead to way how to use OBJECT and LIST. I mean use something like:
"JBAS014688: Wrong type for valid-connection-checker-properties. Expected {OBJECT} but was {[LIST]}"

Comment 2 Petr Kremensky 2014-09-19 08:10:36 UTC
Verified on EAP 6.4.0.DR1.1

[standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:write-attribute(name=valid-connection-checker-properties, value=1)
{
    "outcome" => "failed",
    "failure-description" => "JBAS014688: Wrong type for valid-connection-checker-properties. Expected [OBJECT] but was INT",
    "rolled-back" => true
}
[standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS:write-attribute(name=valid-connection-checker-properties, value={abc:abc})
{
    "outcome" => "failed",
    "failure-description" => "JBAS014688: Wrong type for valid-connection-checker-properties. Expected [OBJECT] but was STRING",
    "rolled-back" => true
}


Note You need to log in before you can comment on or make changes to this bug.