code: public void submit() {
          try {
              completeTasks();
              fetchTasks();
          } catch (Throwable t) {
              StringBuilder sb = new StringBuilder();
              sb.append("Problem processing tasks: ");
              sb.append(t.getClass().getName());
              String m = t.getMessage();
              if (m != null) {
                  sb.append("(");
                  sb.append(m);
                  sb.append(")");
              }
              String msg = sb.toString();
              LOGGER.error(msg, t);
              FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(msg));
          }
      }
docs: Submit.