allow to check StdErr content at debug time

This commit is contained in:
Basile Burg 2016-11-04 15:30:53 +01:00
parent 6ed96833c7
commit 5d84f67e46
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 9 additions and 6 deletions

View File

@ -1324,14 +1324,17 @@ begin
end;
procedure tryRaiseFromStdErr(proc: TProcess);
var
str: string;
begin
if (proc.ExitStatus <> 0) and (poUsePipes in proc.Options) then
with TStringList.Create do
if (proc.ExitStatus <> 0) and (poUsePipes in proc.Options) and not
(poStderrToOutPut in proc.Options) then with TStringList.Create do
try
LoadFromStream(proc.Stderr);
Insert(0, format('tool crashed with code: %d (%s)',
[proc.ExitStatus, shortenPath(proc.Executable)]));
raise Exception.Create(Text);
Insert(0, format('%s crashed with code: %d',
[shortenPath(proc.Executable), proc.ExitStatus]));
str := Text;
raise Exception.Create(str);
finally
free;
end;
@ -1344,7 +1347,7 @@ begin
for i := strings.Count-1 downto 0 do
begin
j := strings.IndexOf(strings[i]);
if (j <> -1) and (j <> i) then
if (j <> -1) and (j < i) then
strings.Delete(i);
end;
end;