You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "SuichII, Christopher" <Ch...@netapp.com> on 2013/11/13 15:28:17 UTC

Question regarding ServerApiException

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.suich@netapp.com
NetApp Software Engineer
Data Center Platforms – Cloud Solutions
Citrix, Cisco & Red Hat


Re: Question regarding ServerApiException

Posted by "SuichII, Christopher" <Ch...@netapp.com>.
That makes perfect sense for regular users. I’ll look into fixing the error messages for storage provisioning (which is only for root admins).

Unless there are any objections, I’ll also override ServerApiException’s getMessage() and getLocalizedMessage() to return getDescription().

-Chris
-- 
Chris Suich
chris.suich@netapp.com
NetApp Software Engineer
Data Center Platforms – Cloud Solutions
Citrix, Cisco & Red Hat

On Nov 13, 2013, at 1:13 PM, Alena Prokharchyk <Al...@citrix.com> wrote:

> Note that regular gets generic messages appended with "…please contact your system administrator" when server side exception happens. Thats by design as regular user doesn't need to know the specifics, all he needs to do – let the admin know, and the admin will do the further debugging/fixing.
> 
> While admin should get the message explaining the root cause of the error. Its a known problem that in lots of the cases CS lacks the details, and it should get fixed. But again, for Root admin only.
> 
> -Alena.
> 
> From: Mike Tutkowski <mi...@solidfire.com>>
> Date: Wednesday, November 13, 2013 9:46 AM
> To: "dev@cloudstack.apache.org<ma...@cloudstack.apache.org>" <de...@cloudstack.apache.org>>
> Cc: Alena Prokharchyk <al...@citrix.com>>, Edison Su <Ed...@citrix.com>>
> Subject: Re: Question regarding ServerApiException
> 
> 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 <Ch...@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.suich@netapp.com<ma...@netapp.com>
> NetApp Software Engineer
> Data Center Platforms – Cloud Solutions
> Citrix, Cisco & Red Hat
> 
> 
> 
> 
> --
> Mike Tutkowski
> Senior CloudStack Developer, SolidFire Inc.
> e: mike.tutkowski@solidfire.com<ma...@solidfire.com>
> o: 303.746.7302
> Advancing the way the world uses the cloud<http://solidfire.com/solution/overview/?video=play>™


Re: Question regarding ServerApiException

Posted by Alena Prokharchyk <Al...@citrix.com>.
Note that regular gets generic messages appended with "…please contact your system administrator" when server side exception happens. Thats by design as regular user doesn't need to know the specifics, all he needs to do – let the admin know, and the admin will do the further debugging/fixing.

While admin should get the message explaining the root cause of the error. Its a known problem that in lots of the cases CS lacks the details, and it should get fixed. But again, for Root admin only.

-Alena.

From: Mike Tutkowski <mi...@solidfire.com>>
Date: Wednesday, November 13, 2013 9:46 AM
To: "dev@cloudstack.apache.org<ma...@cloudstack.apache.org>" <de...@cloudstack.apache.org>>
Cc: Alena Prokharchyk <al...@citrix.com>>, Edison Su <Ed...@citrix.com>>
Subject: Re: Question regarding ServerApiException

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 <Ch...@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.suich@netapp.com<ma...@netapp.com>
NetApp Software Engineer
Data Center Platforms – Cloud Solutions
Citrix, Cisco & Red Hat




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

Re: Question regarding ServerApiException

Posted by Mike Tutkowski <mi...@solidfire.com>.
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.Suich@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.suich@netapp.com
> NetApp Software Engineer
> Data Center Platforms – Cloud Solutions
> Citrix, Cisco & Red Hat
>
>


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