/** * This method is being invoked just before the request is forwarded the the relevant controller. * It should always return true, so the request will be processed in any case of failure. */ @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { try { RequestTelemetryContext context = ThreadContext.getRequestTelemetryContext(); if (context == null) { return true; } String requestName = generateRequestName(request, handler); if (requestName == null) { return true; } context.getHttpRequestTelemetry().setName(requestName); } catch (Exception e) { InternalLogger.INSTANCE.error( "Failed to invoke interceptor '%s' with exception: %s.", this.getClass().getSimpleName(), e.toString()); } return true; }
/** * This method is being invoked just before the request is forwarded the the relevant controller. * It should always return true, so the request will be processed in any case of failure. */ @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { try { RequestTelemetryContext context = ThreadContext.getRequestTelemetryContext(); if (context == null) { return true; } String requestName = generateRequestName(request, handler); if (requestName == null) { return true; } context.getHttpRequestTelemetry().setName(requestName); } catch (Exception e) { InternalLogger.INSTANCE.error( "Failed to invoke interceptor '%s' with exception: %s.", this.getClass().getSimpleName(), e.toString()); } return true; }