package com.ghy.web.core;

import com.ghy.common.core.domain.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Slf4j
@ControllerAdvice
public class GhyExceptionHandler {

    @ExceptionHandler(IllegalArgumentException.class)
    public AjaxResult IllegalArgumentExceptionHandler(IllegalArgumentException e) {
        log.error(e.getMessage(), e);
        return AjaxResult.error(e.getMessage());
    }

}
