Skip to content

Commit

Permalink
Merge pull request #15576 from cdapio/story/stacktraceToLogger
Browse files Browse the repository at this point in the history
[CDAP-20834] Replace usage of printStack with logger
  • Loading branch information
priyanshu-beep authored Apr 4, 2024
2 parents c6e7429 + fe8bbfe commit 3aa4496
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* OAuth handler.
*/
public class OAuthHandler extends AbstractSystemHttpServiceHandler {
private static final Logger LOG = LoggerFactory.getLogger(OAuthHandler.class);
private static final String API_VERSION = "v1";
private static final Gson GSON = new GsonBuilder()
.setPrettyPrinting()
Expand Down Expand Up @@ -362,7 +365,7 @@ private static class OAuthServiceException extends Exception {

void respond(HttpServiceResponder responder) {
if (status == HttpURLConnection.HTTP_INTERNAL_ERROR) {
printStackTrace();
LOG.error("An internal error has occurred", this);
responder.sendError(status, "Internal error");
} else {
responder.sendError(status, getMessage());
Expand Down

0 comments on commit 3aa4496

Please sign in to comment.