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

com.jn.agileway.springboot.web.rest.exceptionhandler.Http503ExceptionHandler Maven / Gradle / Ivy

There is a newer version: 3.1.12
Show newest version
package com.jn.agileway.springboot.web.rest.exceptionhandler;

import com.jn.agileway.http.rest.RestActionException;
import com.jn.agileway.http.rest.RestActionExceptionHandler;
import com.jn.agileway.http.rest.RestActionExceptions;
import com.jn.agileway.web.rest.AbstractServletRestActionExceptionHandler;
import com.jn.langx.http.rest.RestRespBody;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.async.AsyncRequestTimeoutException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
@RestActionExceptions({
        @RestActionException(AsyncRequestTimeoutException.class),
})
public class Http503ExceptionHandler extends AbstractServletRestActionExceptionHandler {
    @Override
    public RestRespBody handle(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
        return RestRespBody.error503("HTTP-503", ex.getMessage());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy