code: private static void setupAWSExceptionLogging(AmazonEC2 ec2) {
      boolean accessible = false;
      Field exceptionUnmarshallersField = null;
      try {
        exceptionUnmarshallersField = AmazonEC2Client.class.getDeclaredField("exceptionUnmarshallers");
        accessible = exceptionUnmarshallersField.isAccessible();
        exceptionUnmarshallersField.setAccessible(true);
        @SuppressWarnings("unchecked") final List<Unmarshaller<AmazonServiceException, Node>> exceptionUnmarshallers = (List<Unmarshaller<AmazonServiceException, Node>>) exceptionUnmarshallersField.get(ec2);
        exceptionUnmarshallers.add(0, new AWSFaultLogger());
        ((AmazonEC2Client) ec2).addRequestHandler((RequestHandler) exceptionUnmarshallers.get(0));
      } catch (Throwable t) {
        //I don't care about this.
      } finally {
        if (exceptionUnmarshallersField != null) {
          try {
            exceptionUnmarshallersField.setAccessible(accessible);
          } catch (SecurityException se) {
            //I don't care about this.
          }
        }
      }
    }
docs: Sets up the AmazonEC2Client to log soap faults from the AWS EC2 api server.