Skip to content

Commit

Permalink
[HWKMETRICS-741] Return NOT_FOUND instead of an internal server error…
Browse files Browse the repository at this point in the history
… for failed namespace lookups; also change the log level for this condition to debug.
  • Loading branch information
Stefan Negrea committed Dec 4, 2017
1 parent 3741faa commit f87de91
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package org.hawkular.openshift.auth.org.hawkular.openshift.namespace;

import static io.undertow.util.StatusCodes.INTERNAL_SERVER_ERROR;
import static io.undertow.util.StatusCodes.NOT_FOUND;

import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -102,8 +102,8 @@ public void handleRequest(HttpServerExchange serverExchange) throws Exception {
namespaceName.add(tenantName);

} else {
log.info("Could not determine a namespace id for namespace. Cannot process request. Returning an INTERNAL_SERVER_ERROR.");
Utils.endExchange(serverExchange, INTERNAL_SERVER_ERROR, "Could not determine a namespace id for namespace " + namespaceID);
log.debug("Could not determine a namespace id for namespace. Cannot process request. Returning NOT_FOUND.");
Utils.endExchange(serverExchange, NOT_FOUND, "Could not determine a namespace id for namespace " + namespaceID);
return;
}
}
Expand Down

0 comments on commit f87de91

Please sign in to comment.