The current implementation of the error handler just propagated exceptions for 
the expected response codes, but ignored all other failed responses. This ended 
up in failed requests to be treated as successful ones, and errors appeared 
later and without the proper context. This PR fixes that.

Also, ProfitBricks returns a `javax.ejb.EJBException` when calling `getImage` 
from an account that has permissions on that image but does not own it. it is 
likely to be a bug on their side, but we can properly handle that, so the 
compute service adapter has been changed to the this into account.

/cc @devcsrj 


You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/928

-- Commit Summary --

  * Properly handler ProfitBricks service errors

-- File Changes --

    M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/compute/ProfitBricksComputeServiceAdapter.java
 (13)
    M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/domain/ServiceFault.java
 (89)
    M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/handlers/ProfitBricksHttpErrorHandler.java
 (11)
    M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/http/ResponseStatusFromPayloadHttpCommandExecutorService.java
 (12)
    M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/http/parser/ServiceFaultResponseHandler.java
 (27)
    M 
providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/parser/ServiceFaultResponseHandlerTest.java
 (32)
    A providers/profitbricks/src/test/resources/fault-500.xml (9)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/928.patch
https://github.com/jclouds/jclouds/pull/928.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/928

Reply via email to