Hey Chris,

I think you've got a great point here. It would be nice if
ServerApiException's getMessage() method were overridden to return
getMessage().

I've noticed on occasion, as well, that exceptions I throw out of my
plug-in get caught elsewhere and a more generic (somewhat useless) error
message is displayed instead of the text I provided.

Talk to you later


On Wed, Nov 13, 2013 at 7:28 AM, SuichII, Christopher <
chris.su...@netapp.com> wrote:

> Alena & Edison (or others),
>
> Is there a reason that ServerApiException has a getDescription() method
> rather than using getMessage() like all other exceptions? This causes
> problems in places where you’d like to treat all exceptions generically and
> be able to simply call getMessage(), but ServerApiException always returns
> null.
>
> For example, I’m trying to fix an issue with StorageManagerImpl, where all
> errors provisioning a new storage pool simply return “Failed to add data
> store” without any actual meaningful error message. In general, we could do
> something like “Failed to add data store: “+e.getMessage(), however, that
> won’t work for ServerApiExceptions and so they would need to be handled
> separately from regular exceptions. One thought I had would be to override
> ServerApiException’s getMessage() and just return the description.
>
> While were on the topic, is there a reason why we shouldn’t update error
> messages like “Failed to add data store” to include the exception’s
> message? It would be very beneficial for plugins and storage vendors to be
> able to return meaningful error messages from failed operations.
>
> -Chris
> --
> Chris Suich
> chris.su...@netapp.com
> NetApp Software Engineer
> Data Center Platforms – Cloud Solutions
> Citrix, Cisco & Red Hat
>
>


-- 
*Mike Tutkowski*
*Senior CloudStack Developer, SolidFire Inc.*
e: mike.tutkow...@solidfire.com
o: 303.746.7302
Advancing the way the world uses the
cloud<http://solidfire.com/solution/overview/?video=play>
*™*

Reply via email to