code: protected BpmnError checkIfCauseOfExceptionIsBpmnError(Throwable e) {
      if (e instanceof BpmnError) {
        return (BpmnError) e;
      } else if (e.getCause() == null) {
        return null;
      }
      return checkIfCauseOfExceptionIsBpmnError(e.getCause());
    }
docs: Searches recursively through the exception to see if the exception itself
  or one of its causes is a {@link BpmnError}.
  
  @param e
  the exception to check
  @return the BpmnError that was the cause of this exception or null if no
  BpmnError was found