mirror of https://gitlab.com/basile.b/dexed.git
display proc params when background tool crashed
This commit is contained in:
parent
2ccc064e62
commit
edad9efe4c
|
@ -15,7 +15,7 @@ uses
|
||||||
{$IFNDEF CEBUILD}
|
{$IFNDEF CEBUILD}
|
||||||
forms,
|
forms,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
process, asyncprocess, ghashmap, ghashset, LCLIntf;
|
process, asyncprocess, ghashmap, ghashset, LCLIntf, strutils;
|
||||||
|
|
||||||
const
|
const
|
||||||
exeExt = {$IFDEF WINDOWS} '.exe' {$ELSE} '' {$ENDIF};
|
exeExt = {$IFDEF WINDOWS} '.exe' {$ELSE} '' {$ENDIF};
|
||||||
|
@ -1311,7 +1311,7 @@ end;
|
||||||
|
|
||||||
procedure tryRaiseFromStdErr(proc: TProcess);
|
procedure tryRaiseFromStdErr(proc: TProcess);
|
||||||
var
|
var
|
||||||
str: string;
|
str: string = '';
|
||||||
begin
|
begin
|
||||||
if (proc.ExitStatus <> 0) and (poUsePipes in proc.Options) and not
|
if (proc.ExitStatus <> 0) and (poUsePipes in proc.Options) and not
|
||||||
(poStderrToOutPut in proc.Options) then with TStringList.Create do
|
(poStderrToOutPut in proc.Options) then with TStringList.Create do
|
||||||
|
@ -1319,7 +1319,10 @@ begin
|
||||||
LoadFromStream(proc.Stderr);
|
LoadFromStream(proc.Stderr);
|
||||||
Insert(0, format('%s crashed with code: %d',
|
Insert(0, format('%s crashed with code: %d',
|
||||||
[shortenPath(proc.Executable), proc.ExitStatus]));
|
[shortenPath(proc.Executable), proc.ExitStatus]));
|
||||||
str := Text;
|
str += 'parameters:'#10;
|
||||||
|
str += proc.Parameters.Text;
|
||||||
|
str += 'stderr:'#10;
|
||||||
|
str += ReplaceStr(Text, #0, #10);
|
||||||
raise Exception.Create(str);
|
raise Exception.Create(str);
|
||||||
finally
|
finally
|
||||||
free;
|
free;
|
||||||
|
|
Loading…
Reference in New Issue