-
Notifications
You must be signed in to change notification settings - Fork 1
/
uErrorHandle.pas
50 lines (41 loc) · 923 Bytes
/
uErrorHandle.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
Oracle Deploy System ver.1.0 (ORDESY)
by Volodymyr Sedler aka scribe
2016
Desc: wrap/deploy/save objects of oracle database.
No warranty of using this program.
Just Free.
With bugs, suggestions please write to [email protected]
On Github: github.com/justscribe/ORDESY
Unit for handle/log errors
}
unit uErrorHandle;
interface
uses
{$IFDEF Debug}
uLog,
{$ENDIF}
SysUtils, Windows, Forms;
procedure HandleError(const Args: array of const);
implementation
procedure HandleError(const Args: array of const);
{$IFDEF Debug}
var
i: integer;
fmtStr, dvdr: string;
{$ENDIF}
begin
{$IFDEF Debug}
dvdr:= '';
for i := 0 to high(Args) do
begin
fmtStr:= fmtStr + dvdr + '%s';
dvdr:= ' | ';
end;
AddToLog(Format(fmtStr, Args));
MessageBox(0, PChar(Format(fmtStr, Args)), PChar('Error'), 48);
{$ELSE}
MessageBox(0, PChar(Args[high(Args)]), PChar('Error'), 48);
{$ENDIF}
end;
end.