package com.lanyuanxiaoyao.service.web.controller.base;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局返回结果类
 *
 * @author lanyuanxiaoyao
 * @date 2023-07-06
 */
@RestControllerAdvice
public class ErrorResponseAdvice {
    @ExceptionHandler(Exception.class)
    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
    public String exception(Exception exception) {
        return exception.getMessage();
    }
}
