Exemple #1
0
  public Exception getCollectedExceptionsOrNull(final Properties ctx) {
    //
    // Services
    final IMsgBL msgBL = Services.get(IMsgBL.class);

    final StringBuilder messageBuilder = new StringBuilder();

    for (final Entry<String, List<LogEntry>> problem2LogEntry : problem2LogEntries.entrySet()) {
      final String message = problem2LogEntry.getKey();
      for (final LogEntry logEntry : problem2LogEntry.getValue()) {
        final String messageTrl = msgBL.getMsg(ctx, message, logEntry.getParams());
        messageBuilder.append("\n").append(messageTrl);
      }
    }

    final String fullMessage = messageBuilder.toString();
    if (Check.isEmpty(fullMessage)) {
      return null; // no exception
    }

    final Exception ex = new Exception(fullMessage);
    return ex;
  }