@msafe/sui3-sdk 0.0.42-pre-ec49ba8.0 → 0.0.42-pre-e22a1ab.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -10443,22 +10443,21 @@ var BackendImpl = class _BackendImpl {
10443
10443
  }
10444
10444
  async get(url, config) {
10445
10445
  const fullUrl = this.getFullUrl(url);
10446
- try {
10447
- return await import_axios2.default.get(fullUrl, config);
10448
- } catch (e) {
10449
- throw BackendError2.fromError(e) ?? e;
10446
+ const response = await import_axios2.default.get(fullUrl, config);
10447
+ if (import_axios2.default.isAxiosError(response)) {
10448
+ const error = BackendError2.fromError(response);
10449
+ throw error ?? new Error(response.statusText);
10450
10450
  }
10451
+ return response;
10451
10452
  }
10452
10453
  async post(url, data, config) {
10453
10454
  const fullUrl = this.getFullUrl(url);
10454
- try {
10455
- const result = await import_axios2.default.post(fullUrl, data, config);
10456
- console.log("\u{1F680} ~ BackendImpl ~ result:", result);
10457
- return result;
10458
- } catch (e) {
10459
- console.log("\u{1F680} ~ BackendImpl ~ e:", e);
10460
- throw BackendError2.fromError(e) ?? e;
10455
+ const response = await import_axios2.default.post(fullUrl, data, config);
10456
+ if (import_axios2.default.isAxiosError(response)) {
10457
+ const error = BackendError2.fromError(response);
10458
+ throw error ?? new Error(response.statusText);
10461
10459
  }
10460
+ return response;
10462
10461
  }
10463
10462
  getFullUrl(url) {
10464
10463
  return url.startsWith(this.apiURL) ? url : `${this.apiURL}${addPrefix(url, "/")}`;