docs: @Override
      public void onError(Session session, Throwable thr) {
          if (onError != null) {
              Object args[] = new Object[onError.getMethod().getParameterTypes().length];
              MethodData methodData = onError.getMethodData();
              //check if method has optional Session parameter
              int sessionIndex = methodData.getSessionIndex();
              if (sessionIndex >= 0) {
                  args[sessionIndex] = session;
              }
              int throableIndx = methodData.getThrowableIndex();
              if (throableIndx >= 0) {
                  args[throableIndx] = thr;
              }
              if (shouldProcessPath) {
                  try {
                      //substitute values for @PathParam values for this method.
                      onError.processPathParameters(this, args);
                  } catch (DecodeException e) {
                      //We can not call onError() again for this since that will result in infinite loop. This is a double error situation,
                      //1) First exception is original exception 'thr' which onError method is called for
                      //2) Secondly, while processing @OnError method's pathparam, there is an exception. Spec is not clear on how to report both exceptions to the user.
                      //We report DecodeException (@PathParam processing issue) first, so that user can correct their @Pathparam parameter in their app
                      //For e.g onError() method, if user has declared parameter as 'int vipLevel'and passed value for vipLevel as 'xyz' by mistake, DecodeException
                      //will occur here and they need to correct it first anyway. Then, for the next invocation user's onError(..) is called with the exception why the
                      //onError(..) is invoked for.
                      thr = e;
                  }
              }
  
              try {
  
                  if (appInstance == null) {
                      if (tc.isDebugEnabled()) {
                          Tr.debug(tc, "application instance is null in onError");
                      }
                      return;
                  }
  
                  onError.getMethod().invoke(appInstance, args);
  
              } catch (IllegalAccessException e) {
                  // allow instrumented FFDC to be used here
              } catch (IllegalArgumentException e) {
                  // allow instrumented FFDC to be used here
              } catch (InvocationTargetException e) {
                  // allow instrumented FFDC to be used here
              }
          } else { //onError() is not defined
              //JSR 356 5.2.2 -->"If the developer has not provided an error handling method on an endpoint that is generating errors, this
              //indicates to the implementation that the developer does not wish to handle such errors. In these cases, the
              //container must make this information available for later analysis, for example by logging it. [WSC-5.2.2-3]"
              if (tc.isDebugEnabled()) {
                  Tr.debug(tc, "Trying to report error: '" + thr.getMessage() + "' calling onError(). However onError() is not defined on the endpoint: " + sepClass.getName());
              }
              //log in FFDC since we could not report it back to the user
              FFDCFilter.processException(thr, getClass().getName(), "288", this);
          }
      }