From edad9efe4c921580f20f0ae63fba5924f533447d Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Thu, 10 Nov 2016 12:12:08 +0100 Subject: [PATCH] display proc params when background tool crashed --- src/ce_common.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ce_common.pas b/src/ce_common.pas index d3c569c7..2eff3482 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -15,7 +15,7 @@ uses {$IFNDEF CEBUILD} forms, {$ENDIF} - process, asyncprocess, ghashmap, ghashset, LCLIntf; + process, asyncprocess, ghashmap, ghashset, LCLIntf, strutils; const exeExt = {$IFDEF WINDOWS} '.exe' {$ELSE} '' {$ENDIF}; @@ -1311,7 +1311,7 @@ end; procedure tryRaiseFromStdErr(proc: TProcess); var - str: string; + str: string = ''; begin if (proc.ExitStatus <> 0) and (poUsePipes in proc.Options) and not (poStderrToOutPut in proc.Options) then with TStringList.Create do @@ -1319,7 +1319,10 @@ begin LoadFromStream(proc.Stderr); Insert(0, format('%s crashed with code: %d', [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); finally free;