mirror of
https://github.com/jlengrand/Maestro.git
synced 2026-03-10 08:31:19 +00:00
Fix EPIPE error when console stdout is disconnected
Wrap console output in try-catch to gracefully handle EPIPE errors that occur when a parent process consuming output dies unexpectedly. Fixes MAESTRO-5C
This commit is contained in:
@@ -167,6 +167,10 @@ class Logger extends EventEmitter {
|
||||
}
|
||||
|
||||
// Also output to console for development
|
||||
// Wrapped in try-catch to handle EPIPE errors when stdout/stderr is disconnected
|
||||
// (e.g., when a parent process consuming output dies unexpectedly)
|
||||
// Fixes MAESTRO-5C
|
||||
try {
|
||||
switch (entry.level) {
|
||||
case 'error':
|
||||
console.error(message, entry.data || '');
|
||||
@@ -189,6 +193,10 @@ class Logger extends EventEmitter {
|
||||
console.info(message, entry.data || '');
|
||||
break;
|
||||
}
|
||||
} catch (err) {
|
||||
// Silently ignore EPIPE errors - console is disconnected
|
||||
// Other errors are also ignored to prevent infinite loops
|
||||
}
|
||||
}
|
||||
|
||||
debug(message: string, context?: string, data?: unknown): void {
|
||||
|
||||
Reference in New Issue
Block a user