@rethinking-studio/clawcontrol 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/index.ts +10 -2
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -106,8 +106,16 @@ const clawcontrolOnboardingAdapter: ChannelOnboardingAdapter = {
106
106
  }
107
107
 
108
108
  if (!createRes.ok) {
109
- const err = await createRes.text();
110
- throw new Error(`Failed to create pairing token: ${err}`);
109
+ const errText = await createRes.text();
110
+ let errMsg = errText;
111
+ try {
112
+ const parsed = JSON.parse(errText);
113
+ if (parsed.details) errMsg = `${parsed.error}: ${parsed.details}`;
114
+ else if (parsed.error) errMsg = parsed.error;
115
+ } catch {
116
+ /* use raw text */
117
+ }
118
+ throw new Error(`Failed to create pairing token: ${errMsg}`);
111
119
  }
112
120
 
113
121
  const { pairingToken, expiresIn } = (await createRes.json()) as { pairingToken: string; expiresIn: number };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rethinking-studio/clawcontrol",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin for ClawAI iOS app - remote control OpenClaw from your phone",
6
6
  "main": "index.ts",