package com.chushang.common.sentinel.handle;

import com.chushang.common.core.web.Result;
import feign.FeignException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * by zhaowenyuan create 2022/4/7 10:00
 * FeignException$BadGateway
 */
@Slf4j
@RestControllerAdvice
public class FeignExceptionHandler {
    @org.springframework.web.bind.annotation.ExceptionHandler(FeignException.class)
    public Result<?> handlerFeignException(FeignException e){
        log.error("",e);
        return Result.failed(502, e.getMessage());
    }
}
