Skip to content

Commit

Permalink
Merge branch 'trunk' into hotfix/validate-logs-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
ariskataoka authored Nov 13, 2024
2 parents fdb46af + 4020878 commit b07a5f5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/bin/vip-wp.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,25 @@ const unpipeStreamsFromProcess = ( { stdin, stdout: outStream } ) => {
};

const bindStreamEvents = ( { subShellRl, commonTrackingParams, isSubShell, stdoutStream } ) => {
const criticalErrors = [
'ECONNRESET',
'ETIMEDOUT',
'EHOSTUNREACH',
'ENOSPC',
'EACCES',
'EMFILE',
'ENOMEM',
];

stdoutStream.on( 'error', err => {
commandRunning = false;

// TODO handle this better
console.error( 'Error: ' + err.message );
if ( criticalErrors.includes( err.code ) ) {
console.error( `Error: ${ err.message }` );
} else {
// TODO handle this better
debug( 'Error: ' + err.message );
}
} );

stdoutStream.on( 'end', async () => {
Expand Down Expand Up @@ -231,7 +245,7 @@ const bindReconnectEvents = ( {
} );

currentJob.socket.io.on( 'reconnect_attempt', attempt => {
console.error( 'There was an error connecting to the server. Retrying...' );
debug( 'There was an error connecting to the server. Retrying...' );

if ( attempt > 1 ) {
return;
Expand Down

0 comments on commit b07a5f5

Please sign in to comment.