if (!resp.ok) {
      throw new Error(errorMsg + ' (' + resp.status + ' ' + resp.statusText + ') ' + JSON.stringify(json))
    }