All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.gjing.AlitxExceptionHandler Maven / Gradle / Ivy

There is a newer version: 1.1.4
Show newest version
package cn.gjing;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Gjing
 **/
@ControllerAdvice
@ResponseBody
public class AlitxExceptionHandler {

    @ExceptionHandler(SmsException.class)
    public ResponseEntity smsException(SmsException e) {
        e.printStackTrace();
        return ResponseEntity.badRequest().body(e.getMessage());
    }

    @ExceptionHandler(OssException.class)
    public ResponseEntity ossException(OssException e) {
        e.printStackTrace();
        return ResponseEntity.badRequest().body(e.getMessage());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy