|
|
@@ -5,12 +5,14 @@ import com.mrxu.framework.common.util.BusinessException;
|
|
|
import feign.Response;
|
|
|
import feign.Util;
|
|
|
import feign.codec.ErrorDecoder;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.lang.annotation.*;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Configuration
|
|
|
public class FeignErrorHandler implements ErrorDecoder {
|
|
|
|
|
|
@@ -25,6 +27,7 @@ public class FeignErrorHandler implements ErrorDecoder {
|
|
|
public Exception decode(String methodKey, Response response) {
|
|
|
try {
|
|
|
String rs = Util.toString(response.body().asReader());
|
|
|
+ log.error(rs);
|
|
|
JSONObject result = JSONObject.parseObject(rs);
|
|
|
return new BusinessException(result.getString("message"));
|
|
|
}
|