diff --git a/package.json b/package.json index cd444ad..e50f461 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "figma-ai-plugin", - "version": "0.1.8", + "version": "0.1.9", "private": true, "dependencies": { "@create-figma-plugin/ui": "^4.0.3", diff --git a/src/main.ts b/src/main.ts index 1c4e144..de338e6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -541,8 +541,8 @@ export default function () { } emit('MODELS_RESULT', { ok: true, models: models, status: res.status, raw: raw, requestEcho: echo }) } catch (e) { - const msg = e instanceof Error ? e.message : (e != null ? String(e) : 'Unknown error') - emit('MODELS_RESULT', { ok: false, error: msg, models: [], status: 0, requestEcho: echo }) + const msg = e instanceof Error ? e.message : (e != null ? (typeof e === 'string' ? e : JSON.stringify(e)) : 'Unknown error') + emit('MODELS_RESULT', { ok: false, error: msg, models: [], status: 0, raw: (e != null ? JSON.stringify(e) : ''), requestEcho: echo }) } }) diff --git a/src/ui.tsx b/src/ui.tsx index 3a9508f..fe0f1c3 100644 --- a/src/ui.tsx +++ b/src/ui.tsx @@ -29,7 +29,7 @@ const MIN_WINDOW_SIZE = { width: 320, height: 200 } // very high — actual clamp is done by main via clampWindowSize (bounds*zoom). // Full plugin version shown in the footer status bar. Keep in sync with package.json "version". -const PLUGIN_VERSION = '0.1.8' +const PLUGIN_VERSION = '0.1.9' const fieldStyle = { display: 'flex',