com.jn.agileway.springboot.web.rest.exceptionhandler.Http503ExceptionHandler Maven / Gradle / Ivy
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