> +import org.jclouds.labs.b2.domain.B2Error;
> +
> +import com.google.inject.Inject;
> +import com.google.inject.TypeLiteral;
> +
> +public class ParseB2ErrorFromJsonContent extends ParseJson<B2Error>
> implements HttpErrorHandler {
> +
> + @Inject
> + public ParseB2ErrorFromJsonContent(Json json) {
> + super(json, TypeLiteral.get(B2Error.class));
> + }
> +
> + private static Exception refineException(B2Error error, Exception
> exception) {
> + if ("bad_json".equals(error.code())) {
> + return new IllegalArgumentException(error.message(), exception);
> + } else {
Also try to refine 404 errors to a ResourceNotFoundException to let the 404
fallbacks work
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/270/files/8bb355e1b286b2bbf77fd8d3cb75cd2d1aa6bc69#r64487543