Subject | Why IBO limits exception text length to 255 chars? |
---|---|
Author | Carlos H. Cantu |
Post date | 2008-09-12T13:43:50Z |
Many times, I get truncated (cut) exception messages with IBO. This is
terrible to debug errors happening in "outside" customers, since the
reported error message will not contain the full information about the
error.
Doing some debug, I found the following code in IBODataset unit:
constructor EIBO_ISCError.CreateISC( Sender: TObject;
MessageText: string;
AERRCODE: longint;
AErrorMessage: TStringList;
AErrorCodes: TStringList;
ASQLCODE: longint;
ASQLMessage: TStringList;
ASQL: TStringList );
var
tmpTxt: string;
begin
tmpTxt := MessageText;
if Length( tmpTxt ) > 255 then <================= WHY???
SetLength( tmpTxt, 255 );
inherited Create( tmpTxt );
FSender := Sender;
FERRCODE := AERRCODE;
FErrorMessage := TStringList.Create;
FErrorCodes := TStringList.Create;
FSQLCODE := ASQLCODE;
FSQLMessage := TStringList.Create;
FSQL := TStringList.Create;
FErrorMessage.Assign( AErrorMessage );
FErrorCodes.Assign( AErrorCodes );
FsqlMessage.Assign( AsqlMessage );
Fsql.Assign( Asql );
end;
Question is: Why IBO restrict the message length to 255 chars? I
commented that IF and the full messages were show, so I guess there is
no problem in raising exceptions with big messages.
Can anyone explain this?
[]s
Cantu
http://www.firebirdnews.org
FireBase - http://www.FireBase.com.br
terrible to debug errors happening in "outside" customers, since the
reported error message will not contain the full information about the
error.
Doing some debug, I found the following code in IBODataset unit:
constructor EIBO_ISCError.CreateISC( Sender: TObject;
MessageText: string;
AERRCODE: longint;
AErrorMessage: TStringList;
AErrorCodes: TStringList;
ASQLCODE: longint;
ASQLMessage: TStringList;
ASQL: TStringList );
var
tmpTxt: string;
begin
tmpTxt := MessageText;
if Length( tmpTxt ) > 255 then <================= WHY???
SetLength( tmpTxt, 255 );
inherited Create( tmpTxt );
FSender := Sender;
FERRCODE := AERRCODE;
FErrorMessage := TStringList.Create;
FErrorCodes := TStringList.Create;
FSQLCODE := ASQLCODE;
FSQLMessage := TStringList.Create;
FSQL := TStringList.Create;
FErrorMessage.Assign( AErrorMessage );
FErrorCodes.Assign( AErrorCodes );
FsqlMessage.Assign( AsqlMessage );
Fsql.Assign( Asql );
end;
Question is: Why IBO restrict the message length to 255 chars? I
commented that IF and the full messages were show, so I guess there is
no problem in raising exceptions with big messages.
Can anyone explain this?
[]s
Cantu
http://www.firebirdnews.org
FireBase - http://www.FireBase.com.br