if (!resp.ok) {
        return resp.json().then(function (json) {
          throw new Error('Could not download recording ' + recordingId + ' (' + resp.status + ' ' + resp.statusText + ') ' + JSON.stringify(json))
        })
      }