@leg3ndy/otto-bridge 0.1.2 → 0.1.3

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/README.md CHANGED
@@ -31,7 +31,7 @@ Enquanto o pacote nao estiver publicado, voce pode gerar um tarball local:
31
31
 
32
32
  ```bash
33
33
  npm pack
34
- npm install -g ./leg3ndy-otto-bridge-0.1.2.tgz
34
+ npm install -g ./leg3ndy-otto-bridge-0.1.3.tgz
35
35
  ```
36
36
 
37
37
  ## Publicacao
package/dist/http.js CHANGED
@@ -4,7 +4,15 @@ function normalizeBaseUrl(apiBaseUrl) {
4
4
  return raw.replace(/\/+$/, "");
5
5
  }
6
6
  async function requestJson(apiBaseUrl, pathname, init) {
7
- const response = await fetch(`${normalizeBaseUrl(apiBaseUrl)}${pathname}`, init);
7
+ const requestUrl = `${normalizeBaseUrl(apiBaseUrl)}${pathname}`;
8
+ let response;
9
+ try {
10
+ response = await fetch(requestUrl, init);
11
+ }
12
+ catch (error) {
13
+ const detail = error instanceof Error ? error.message : String(error);
14
+ throw new Error(`Request failed for ${requestUrl}: ${detail}`);
15
+ }
8
16
  const payload = (await response.json().catch(() => null));
9
17
  if (!response.ok) {
10
18
  const detail = payload && typeof payload === "object" && payload !== null
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const BRIDGE_CONFIG_VERSION = 1;
2
- export const BRIDGE_VERSION = "0.1.2";
2
+ export const BRIDGE_VERSION = "0.1.3";
3
3
  export const BRIDGE_PACKAGE_NAME = "@leg3ndy/otto-bridge";
4
4
  export const DEFAULT_API_BASE_URL = "http://localhost:8000";
5
5
  export const DEFAULT_POLL_INTERVAL_MS = 3000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leg3ndy/otto-bridge",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Local companion for Otto Bridge device pairing and WebSocket runtime.",