Skip to content

Commit

Permalink
Add proposal message to change stdout max buffer length preference...
Browse files Browse the repository at this point in the history
...in case of 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' error appearance

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
  • Loading branch information
vrubezhny authored and datho7561 committed Apr 17, 2024
1 parent 7417a94 commit 1b2fdf9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*-----------------------------------------------------------------------------------------------*/

import { VSCodeSettings } from '@redhat-developer/vscode-redhat-telemetry/lib/common/vscode/settings';
import * as vscode from 'vscode';
import * as cp from 'child_process';
import { CommandText } from './base/command';
import { ToolsConfig } from './tools';
Expand Down Expand Up @@ -59,6 +60,14 @@ export class CliChannel {
const optsCopy = CliChannel.applyEnv(opts, CliChannel.createTelemetryEnv())
const result: CliExitData = await ChildProcessUtil.Instance.execute(toolLocation ? commandActual.replace(cmd, `"${toolLocation}"`) : commandActual, optsCopy);
if (result.error && fail) {
if (result.error.code && result.error.code.toString() === 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER') {
void vscode.window.showErrorMessage('Do you want to change the maximum \'stdout\' buffer size by modifying the \'openshiftToolkit.execMaxBufferLength\' preference value?', 'Yes', 'Cancel')
.then((answer)=> {
if (answer === 'Yes') {
void vscode.commands.executeCommand('workbench.action.openSettings', 'openshiftToolkit.execMaxBufferLength');
}
});
}
throw new VsCommandError(`${result.error.message}`, `Error when running command: ${commandPrivacy}`, result.error);
};
return result;
Expand Down

0 comments on commit 1b2fdf9

Please sign in to comment.