appback-ai-agent 1.0.4 → 1.0.5
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 +1 -1
- package/src/index.js +13 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// Global error handler — catch native module failures etc.
|
|
2
|
+
process.on('uncaughtException', (err) => {
|
|
3
|
+
console.error('[FATAL] Uncaught exception:', err.message || err)
|
|
4
|
+
if (String(err.message).includes('better-sqlite3') || String(err.message).includes('better_sqlite3')) {
|
|
5
|
+
console.error('\n better-sqlite3 failed to load.')
|
|
6
|
+
console.error(' On Windows, run: npm install --global windows-build-tools')
|
|
7
|
+
console.error(' Or install Visual Studio C++ Build Tools + Python 3.\n')
|
|
8
|
+
}
|
|
9
|
+
console.error(err.stack || err)
|
|
10
|
+
process.exit(1)
|
|
11
|
+
})
|
|
12
|
+
|
|
1
13
|
// CLI(bin/cli.js)에서 이미 로드한 경우 스킵
|
|
2
14
|
if (!process.env._PKG_ROOT) require('dotenv').config()
|
|
3
15
|
|
|
@@ -105,5 +117,6 @@ async function main() {
|
|
|
105
117
|
|
|
106
118
|
main().catch(err => {
|
|
107
119
|
log.error('Fatal error', err.message)
|
|
120
|
+
console.error(err.stack || err)
|
|
108
121
|
process.exit(1)
|
|
109
122
|
})
|