code: private Event newEvent(final String id, final Exception error) {
          return new EventFactorySupport().event(this, id, new LocalAttributeMap<>("error", error));
      }
docs: New event based on the id, which contains an error attribute referring to the exception occurred.
  
  @param id    the id
  @param error the error
  @return the event