fix: improve error handling and logging for extractor and cleaner

- Load .env file in main process using dotenv
- Add detailed console logging for debugging
- Add validation for ERP configuration before extraction
- Improve error display in UI with selectable text
- Add stack trace logging for better debugging
This commit is contained in:
Misaka
2026-03-01 16:07:47 +08:00
parent e794470d69
commit e04337dc19
4 changed files with 91 additions and 16 deletions

View File

@@ -3,6 +3,14 @@ import { join } from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import icon from '../../resources/icon.png?asset'
import { registerIpcHandlers } from './ipc'
import * as dotenv from 'dotenv'
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'path'
// Load environment variables from .env file
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
dotenv.config({ path: resolve(__dirname, '../../.env') })
function createWindow(): void {
// Create the browser window.