Log errors when welcome page can't be shown on Quarkus (#14995)

Closes #14994
This commit is contained in:
Alexander Schwartz 2022-10-21 07:38:33 +02:00 committed by GitHub
parent 2d55e1dab7
commit 1059b3a837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,9 +82,6 @@ public class QuarkusWelcomeResource {
/**
* Welcome page of Keycloak
*
* @return
* @throws URISyntaxException
*/
@GET
@Produces(MediaType.TEXT_HTML_UTF_8)
@ -146,9 +143,6 @@ public class QuarkusWelcomeResource {
/**
* Resources for welcome page
*
* @param path
* @return
*/
@GET
@Path("/welcome-content/{path}")
@ -164,7 +158,7 @@ public class QuarkusWelcomeResource {
return Response.status(Response.Status.NOT_FOUND).build();
}
} catch (IOException e) {
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
}
}
@ -213,7 +207,7 @@ public class QuarkusWelcomeResource {
.cacheControl(CacheControlUtil.noCache());
return rb.build();
} catch (Exception e) {
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
}
}
@ -236,7 +230,7 @@ public class QuarkusWelcomeResource {
try {
return session.theme().getTheme(Theme.Type.WELCOME);
} catch (IOException e) {
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
}
}
@ -267,7 +261,7 @@ public class QuarkusWelcomeResource {
// So consider that welcome page accessed locally just if it was accessed really through "localhost" URL and without loadbalancer (x-forwarded-for header is empty).
return isLocalAddress(remoteInetAddress) && isLocalAddress(localInetAddress) && xForwardedFor == null;
} catch (UnknownHostException e) {
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
}
}