@cstar.help/js 0.3.3 → 0.3.4

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
@@ -137,7 +137,13 @@ var HttpClient = class {
137
137
  signal: AbortSignal.timeout(this.config.timeout)
138
138
  });
139
139
  } catch (err) {
140
- lastError = err instanceof Error ? err : new Error(String(err));
140
+ const networkErr = err instanceof Error ? err : new Error(String(err));
141
+ lastError = new CStarError(0, {
142
+ type: "connection_error",
143
+ code: "network_error",
144
+ message: `Network request failed: ${networkErr.message}`,
145
+ doc_url: "https://www.cstar.help/developers/errors#connection-errors"
146
+ });
141
147
  if (attempt < this.config.maxRetries) continue;
142
148
  throw lastError;
143
149
  }
package/dist/index.js CHANGED
@@ -105,7 +105,13 @@ var HttpClient = class {
105
105
  signal: AbortSignal.timeout(this.config.timeout)
106
106
  });
107
107
  } catch (err) {
108
- lastError = err instanceof Error ? err : new Error(String(err));
108
+ const networkErr = err instanceof Error ? err : new Error(String(err));
109
+ lastError = new CStarError(0, {
110
+ type: "connection_error",
111
+ code: "network_error",
112
+ message: `Network request failed: ${networkErr.message}`,
113
+ doc_url: "https://www.cstar.help/developers/errors#connection-errors"
114
+ });
109
115
  if (attempt < this.config.maxRetries) continue;
110
116
  throw lastError;
111
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cstar.help/js",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Official TypeScript SDK for the cStar customer support platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",