private MicrosoftApiResponse tryWithCredsOrFail(Request.Builder req, String causeMessage)
      throws IOException, DestinationMemoryFullException, PermissionDeniedException {
    Pair<Request, MicrosoftApiResponse> reqResp = tryWithCreds(req);
    MicrosoftApiResponse response = reqResp.getRight();
    Optional<MicrosoftApiResponse.RecoverableState> recovery = response.recoverableState();
    if (recovery.isPresent()) {
      switch (recovery.get()) {
        case RECOVERABLE_STATE_OKAY:
          return response;
        case RECOVERABLE_STATE_NEEDS_TOKEN_REFRESH:
          throw response.toIoException(
              String.format(
                  "bug! microsoft server needs token refresh immediately after a refreshing: %s",
                  causeMessage));
      }
      throw new AssertionError("exhaustive switch");
    }
    return response.returnConvertDtpException(
        String.format(
            "%s: for request url \"%s\" and bearer token \"%s\"\n",
            causeMessage, reqResp.getLeft().url(), credential.getAccessToken()));
  }
Try a request to Microsoft servers or fail with a critical DTP exception, after considering
standard token-refresh retry options.

<p>Prefer {@link tryWithCredsOrFail(Request.Builder, String, String)} if you ultimately only
care about a particular JSON key in the response body. If you don't
need/expect a response body (or don't know yet) then this is the right
method to call instead (and then call {@link
MicrosoftApiResponse#getJsonValue} yourself later).

<p>Example usage:

<pre>{@code
MicrosoftApiResponse resp = tryWithCredsOrFail(request, "creating a folder");
checkState(resp.isOkay(), "bug: tryWithCredsOrFail() should have returne healthy resp");
// ...carry on as normal with business logic...
}</pre>

@param causeMessage a contextual message to include as the root cause/context when throwing a
    DTP excption.
@return server response.
extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/media/MicrosoftMediaImporter.java