home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 October
/
Chip_2001-10_cd1.bin
/
zkuste
/
delphi
/
kompon
/
d45
/
ARDOCI.ZIP
/
OraError.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-03-01
|
1KB
|
46 lines
unit OraError;
interface
uses SysUtils, OraDefines;
type
EOraError = class(Exception)
private
FErrorType:sword;
FErrorCode:sb4;
FErrorText:string;
public
constructor Create(EType:sword;ECode:sb4;EText:string);
destructor Destroy;override;
property ErrorType:sword read FErrorType;
property ErrorCode:sb4 read FErrorCode;
property Text:string read FErrorText;
end;
implementation
constructor EOraError.Create(EType:sword;ECode:sb4;EText:string);
begin
// Errors with numbers 20010-20050 are reserved for user information messages (not errors) from database.
// Cut all debug info (such as error line,name of procedure) from error message text.
// Leaves only user information message.
// User information message should have the following format for example
// Example PL/SQL code how to raise user information message:
// raise_application_error(-20010,'{You cannot do this operation because ....}');
FErrorText:=EText; // full error text
FErrorType:=EType;
FErrorCode:=ECode;
if (ECode>=20010) and (ECode<=20050) then
if Pos('{', EText) <> 0 then EText := Copy(EText, Pos('{', EText)+1, Pos('}', EText)-Pos('{', EText)-1);
inherited Create(EText);
end;
destructor EOraError.Destroy;
begin
inherited Destroy;
end;
end.