🚧 Error Handling
This commit is contained in:
parent
c93326b38f
commit
7876694214
@ -16,6 +16,8 @@ import jakarta.ws.rs.core.Context;
|
|||||||
import jakarta.ws.rs.core.Link;
|
import jakarta.ws.rs.core.Link;
|
||||||
import jakarta.ws.rs.core.MediaType;
|
import jakarta.ws.rs.core.MediaType;
|
||||||
import jakarta.ws.rs.core.Response;
|
import jakarta.ws.rs.core.Response;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -28,6 +30,8 @@ import java.util.*;
|
|||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class ProxyResource
|
public class ProxyResource
|
||||||
{
|
{
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(ProxyResource.class);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
RouteService routeService;
|
RouteService routeService;
|
||||||
|
|
||||||
@ -62,11 +66,13 @@ public class ProxyResource
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
LOG.error("Error occurred on upstream.", e);
|
||||||
ResponseHandler.error(context);
|
ResponseHandler.error(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
LOG.error("No route found for request path '{}'", context.request().path());
|
||||||
ResponseHandler.notFound(context);
|
ResponseHandler.notFound(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user