MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / notFound

Method notFound

src/tsd/HttpQuery.java:439–458  ·  view source on GitHub ↗

Sends a 404 error page to the client. Handles responses from deprecated API calls

()

Source from the content-addressed store, hash-verified

437 * Handles responses from deprecated API calls
438 */
439 @Override
440 public void notFound() {
441 logWarn("Not Found: " + request().getUri());
442 if (this.api_version > 0) {
443 // always default to the latest version of the error formatter since we
444 // need to return something
445 switch (this.api_version) {
446 case 1:
447 default:
448 sendReply(HttpResponseStatus.NOT_FOUND, serializer.formatNotFoundV1());
449 }
450 return;
451 }
452 if (hasQueryStringParam("json")) {
453 sendReply(HttpResponseStatus.NOT_FOUND,
454 new StringBuilder("{\"err\":\"Page Not Found\"}"));
455 } else {
456 sendReply(HttpResponseStatus.NOT_FOUND, PAGE_NOT_FOUND);
457 }
458 }
459
460 /** Redirects the client's browser to the given location. */
461 public void redirect(final String location) {

Callers 4

notFoundDeprecatedMethod · 0.95
handleHttpQueryMethod · 0.95

Calls 5

sendReplyMethod · 0.95
formatNotFoundV1Method · 0.80
logWarnMethod · 0.45
requestMethod · 0.45
hasQueryStringParamMethod · 0.45

Tested by 3

notFoundDeprecatedMethod · 0.76