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

Reply via email to