code: private <T> Promise<T> sanitize(Promise<T> promise) {
  		return promise.thenEx((value, e) -> {
  			if (e == null) {
  				return Promise.of(value);
  			} else {
  				close(e);
  				return Promise.ofException(e);
  			}
  		});
  	}
docs: endregion