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

@@ -124,7 +124,10 @@ export const ExtractorPage: React.FC = () => {
{error && (
<div className="error-section">
<h3></h3>
<p>{error}</p>
<div className="error-message" title="双击可选中复制">
{error}
</div>
<p className="error-hint">💡 </p>
</div>
)}
@@ -286,9 +289,27 @@ export const ExtractorPage: React.FC = () => {
margin: 0 0 8px 0;
font-size: 16px;
}
.error-section p {
color: #666;
margin: 0;
.error-message {
background: #fff;
padding: 12px;
border-radius: 4px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 13px;
color: #333;
border: 1px solid #ffccc7;
user-select: text;
-webkit-user-select: text;
cursor: text;
white-space: pre-wrap;
word-break: break-all;
}
.error-message:hover {
background: #fffbfc;
}
.error-hint {
color: #999;
font-size: 12px;
margin: 8px 0 0 0;
}
.result-section {
margin-top: 24px;