Skip to content

Commit 1b2fdf9

Browse files
vrubezhnydatho7561
authored andcommitted
Add proposal message to change stdout max buffer length preference...
...in case of 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' error appearance Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
1 parent 7417a94 commit 1b2fdf9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cli.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*-----------------------------------------------------------------------------------------------*/
55

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

0 commit comments

Comments
 (0)