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