Download src/openwork/openwork-errors.js from VanyaJ/bada-terminal: direct link, hf CLI and curl.
- Browser
- Download file 2.25 kB
-
https://huggingface.co/VanyaJ/bada-terminal/resolve/main/src/openwork/openwork-errors.js
- Command line
-
hf download hf://VanyaJ/bada-terminal/src/openwork/openwork-errors.js
-
curl -L -o openwork-errors.js https://huggingface.co/VanyaJ/bada-terminal/resolve/main/src/openwork/openwork-errors.js
2.25 kB
| // ๋ ๋๋ฌ์ ํ ์คํธ๊ฐ ๊ณต์ ํ๋ ๊ฐ์ฑ ๋ณต๊ตฌ ์๋ด. docs/specs/bada-runtime-integration.md v1.0.0 | |
| function formatOpenWorkError(rawError) { | |
| if (!rawError) return 'OpenWork ๋ก์ปฌ ์บ๋ฒ์ค ์๋ฒ๊ฐ ์์ง ๊นจ์ด๋์ง ๋ชปํ์ต๋๋ค.'; | |
| if (/EADDRINUSE|port\s+\d+.*(?:use|occupied)/i.test(rawError)) { | |
| return '์บ๋ฒ์ค ํฌํธ(54321)๊ฐ ๋ค๋ฅธ ํ๋ก์ธ์ค์ ์ ์ ๋์ด ์์ต๋๋ค. ํฐ๋ฏธ๋์์ ํด๋น ํ๋ก์ธ์ค๋ฅผ ์ข ๋ฃํด ์ฃผ์ธ์.'; | |
| } | |
| if (/ENOENT|not found|No Node|Node\.js v22|node:sqlite/i.test(rawError)) { | |
| return 'Node.js ๋ฐํ์์ ์ค๋นํด ์ฃผ์ธ์. Node.js v22+์ ๋ก์ปฌ ์ ์ฅ์ ๊ธฐ๋ฅ์ ํ์ธํ๋ฉด ๋ค์ ๋ง๋ ์ ์์ต๋๋ค.'; | |
| } | |
| if (/failed to respond|timeout|probeHealth/i.test(rawError)) { | |
| return 'OpenWork ์๋ฒ๊ฐ ์๊ฐ ๋ด์ ์๋ตํ์ง ์์์ต๋๋ค. ๋ค์ ์จ ๋ถ์ด๋ฃ๊ธฐ๋ฅผ ์๋ํด ์ฃผ์ธ์.'; | |
| } | |
| if (/policy configuration|MCP policy connection|workspace.*directory/i.test(rawError)) { | |
| return '์์ ๊ณต๊ฐ์ ์ฐ๊ฒฐ ์ค์ ์ ์ค๋นํ์ง ๋ชปํ์ต๋๋ค. ํด๋์ ์ค์ ํ์ผ์ ํ์ธํ ๋ค ๋ค์ ์จ ๋ถ์ด๋ฃ์ด ์ฃผ์ธ์.'; | |
| } | |
| if (/cancelled|process exited/i.test(rawError)) return '์บ๋ฒ์ค ์ค๋น๊ฐ ์ ์ ๋ฉ์ท์ต๋๋ค. ๋ค์ ์จ ๋ถ์ด๋ฃ๊ธฐ๋ก ์ด์ด๊ฐ ์ ์์ต๋๋ค.'; | |
| return '์บ๋ฒ์ค์์ ์ฐ๊ฒฐ์ด ์ ์ ์ฌ๊ณ ์์ต๋๋ค. ๋ค์ ์จ ๋ถ์ด๋ฃ๊ธฐ๋ฅผ ์๋ํด ์ฃผ์ธ์.'; | |
| } | |
| function formatRecoveryGuide(errMsg) { | |
| if (errMsg?.includes('ํฌํธ')) return 'ใlsof -i :54321ใ ๋๋ ใnetstat -an | findstr 54321ใ๋ก ์ ์ ํ๋ก์ธ์ค๋ฅผ ํ์ธ ํ ์ข ๋ฃํด ์ฃผ์ธ์.'; | |
| if (errMsg?.includes('Node.js')) return 'ใnode --versionใ์ผ๋ก Node.js ์ค์น๋ฅผ ํ์ธํ์ธ์. nvm, brew, ๋๋ ๊ณต์ ์ค์น ํจํค์ง๋ฅผ ๊ถ์ฅํฉ๋๋ค.'; | |
| return 'ใ๋ค์ ์จ ๋ถ์ด๋ฃ๊ธฐใ ๋ฒํผ์ผ๋ก ์ฌ์๋ํ๊ฑฐ๋ CLI ํฐ๋ฏธ๋์์ ์์ ์ ๊ณ์ํ ์ ์์ต๋๋ค.'; | |
| } | |
| // ๊ฐ์ ์๋ด๋ฅผ native CommonJS์ ์น renderer๊ฐ ๊ณต์ ํ๋ค. | |
| // ์ค๋ช ๋ฌธ์: docs/specs/web-renderer-modules.md v1.0.0 | |
| if (typeof module === 'object' && module.exports) module.exports = { formatOpenWorkError, formatRecoveryGuide }; | |
| else globalThis.BadaOpenWorkErrors = { formatOpenWorkError, formatRecoveryGuide }; | |