code: @Override
      public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) {
          final String message;
          final String stacktrace;
          if (jobException == null) {
              message = null;
              stacktrace = null;
          } else {
              message = jobException.getMessage();
              StringWriter stackTraceWriter = new StringWriter(200);
              jobException.printStackTrace(new PrintWriter(stackTraceWriter));
              stacktrace = stackTraceWriter.toString();
          }
  
          JobStatsContext statsContext = statsContextThreadLocal.get();
          statsContextThreadLocal.remove();
  
          if (statsContext != null) {
              addExecution(statsContext, message, stacktrace);
          }
      }
docs: {@inheritDoc}