@djangocfg/centrifugo 2.1.60 → 2.1.63

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/centrifugo",
3
- "version": "2.1.60",
3
+ "version": "2.1.63",
4
4
  "description": "Production-ready Centrifugo WebSocket client for React with real-time subscriptions, RPC patterns, and connection state management",
5
5
  "keywords": [
6
6
  "centrifugo",
@@ -51,9 +51,9 @@
51
51
  "centrifuge": "^5.2.2"
52
52
  },
53
53
  "peerDependencies": {
54
- "@djangocfg/api": "^2.1.60",
55
- "@djangocfg/ui-nextjs": "^2.1.60",
56
- "@djangocfg/layouts": "^2.1.60",
54
+ "@djangocfg/api": "^2.1.63",
55
+ "@djangocfg/ui-nextjs": "^2.1.63",
56
+ "@djangocfg/layouts": "^2.1.63",
57
57
  "consola": "^3.4.2",
58
58
  "lucide-react": "^0.545.0",
59
59
  "moment": "^2.30.1",
@@ -61,7 +61,7 @@
61
61
  "react-dom": "^19.1.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@djangocfg/typescript-config": "^2.1.60",
64
+ "@djangocfg/typescript-config": "^2.1.63",
65
65
  "@types/react": "^19.1.0",
66
66
  "@types/react-dom": "^19.1.0",
67
67
  "moment": "^2.30.1",
@@ -229,7 +229,17 @@ export async function namedRPC<TRequest = any, TResponse = any>(
229
229
  logger.error(`Native RPC failed: ${method}`, error);
230
230
 
231
231
  // Dispatch error event for ErrorsTracker
232
- const errorMessage = error instanceof Error ? error.message : String(error);
232
+ // Handle different error formats: Error objects, plain objects with message, or stringify
233
+ let errorMessage: string;
234
+ if (error instanceof Error) {
235
+ errorMessage = error.message;
236
+ } else if (typeof error === 'object' && error !== null) {
237
+ // Try to extract message from object, fallback to JSON stringify
238
+ const errObj = error as Record<string, unknown>;
239
+ errorMessage = (errObj.message as string) || (errObj.error as string) || JSON.stringify(error);
240
+ } else {
241
+ errorMessage = String(error);
242
+ }
233
243
  const errorCode = (error as any)?.code;
234
244
  dispatchCentrifugoError({
235
245
  method,