PDA

View Full Version : Additional Information for an exception


Dietmar Brueckmann
07-Sep-2005, 02:16 PM
Hi,

I've asked this question some times ago. And the answer was version 5 would
get the feature.

My problem:

In case of an SQL-error I'm using my own dialog (TfoSqlFehler or a
descendant) for easy getting the used SQL.
The dialog shows the error-message and the used SQL + SQL with inserted
parameter-values if it is a parametrized query.
______________________________________________
TSqlFehlerBehandeln = class(TEurekaLog)

procedure TSqlFehlerBehandeln.aOnException(Sender: TObject; E: Exception);
var
foSqlFehler : TfoSqlFehler;
begin
if (E is EStdSql) and (SqlFehlerFormularClass <> nil) then begin
foSqlFehler := SqlFehlerFormularClass.Create(nil);
try
foSqlFehler.ExceptionBehandeln(EStdSql(E));
finally
FreeAndNil(foSqlFehler);
end;
end;
end;
procedure TSqlFehlerBehandeln.SFB_ExceptionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);
begin
inherited;
Handled := not (EurekaExceptionRecord.ExceptionObject is EStdSql);
end;
procedure TSqlFehlerBehandeln.SFB_ExceptionActionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord;
EurekaAction: TEurekaActionType; var Execute: Boolean);
begin
inherited;
case EurekaAction of
atShowingExceptionInfo: if EurekaExceptionRecord.ExceptionObject is
EStdSql
then Execute := False;
end;
end;
constructor TSqlFehlerBehandeln.Create(AOwner: TComponent);
begin
inherited;
Application.OnException := aOnException;
OnExceptionNotify := SFB_ExceptionNotify;
OnExceptionActionNotify := SFB_ExceptionActionNotify;
end;
______________________________________________

an unimported question: I don't know, where I found the basics to the code
above. Is there a tutorial I don't know.

the really question:

I'd like to integrate my informations into the Euraklog-dialog.
1. to add the SQL-informations to the log-file
2. to prevent showing large SQL-statements beneath the important
error-message. The users are confused in seeing long error messages. The
information should only be visible after pressing "Details", like Eurekalog
does.

In the help I can see a Tabsheet of the Eurekalog-dialog named "other".
If I could use it, it would help. But how to use - I did'nt find any
information not in .chm nor in the .pas of the source or demo-files.

It would be fine to use a descendant of the original-Eurekalog-dialog (for
changing "Other" to "SQL" - but that#s not necessary.


--
Best regards
Dietmar Brueckmann

Dietmar Brueckmann
08-Sep-2005, 01:22 PM
Am Wed, 7 Sep 2005 16:15:21 +0200 schrieb Dietmar Brueckmann:

> It would be fine to use a descendant of the original-Eurekalog-dialog (for
> changing "Other" to "SQL" - but that#s not necessary.

Because of "out off office" one additional remark:
A descendent would be nice, because I would like to use a TRichEdit for the
erroneous SQL to show the mistake in red color.

--
Best regards
Dietmar Brueckmann

admin
16-Sep-2005, 09:50 AM
Dietmar Brueckmann wrote:
> Hi,
>
> I've asked this question some times ago. And the answer was version 5 would
> get the feature.
>
> My problem:
>
> In case of an SQL-error I'm using my own dialog (TfoSqlFehler or a
> descendant) for easy getting the used SQL.
> The dialog shows the error-message and the used SQL + SQL with inserted
> parameter-values if it is a parametrized query.
>
> [...]
>
> an unimported question: I don't know, where I found the basics to the code
> above. Is there a tutorial I don't know.
>
> the really question:
>
> I'd like to integrate my informations into the Euraklog-dialog.
> 1. to add the SQL-informations to the log-file

To add custom data to the EurekaLog log file you should use the
CustomDataRequest event.

> 2. to prevent showing large SQL-statements beneath the important
> error-message. The users are confused in seeing long error messages. The
> information should only be visible after pressing "Details", like Eurekalog
> does.
>
> In the help I can see a Tabsheet of the Eurekalog-dialog named "other".
> If I could use it, it would help. But how to use - I did'nt find any
> information not in .chm nor in the .pas of the source or demo-files.
>
> It would be fine to use a descendant of the original-Eurekalog-dialog (for
> changing "Other" to "SQL" - but that#s not necessary.
>
>

To modify the "Other" Tabsheet name change the valud of the
"Project/EurekaLog Options.../Messages/Exception Dialog/Custom Data ..."
fields.

--
Best regards...

Fabio Dell'Aria.

admin
16-Sep-2005, 09:52 AM
Dietmar Brueckmann wrote:
> Am Wed, 7 Sep 2005 16:15:21 +0200 schrieb Dietmar Brueckmann:
>
>
>>It would be fine to use a descendant of the original-Eurekalog-dialog (for
>>changing "Other" to "SQL" - but that#s not necessary.
>
>
> Because of "out off office" one additional remark:
> A descendent would be nice, because I would like to use a TRichEdit for the
> erroneous SQL to show the mistake in red color.
>

But if you format the text as RTF then the log file text will be
illegible by a normal text editor.

Can you add a new thread in the suggestion forum newsgroups, please?

--
Best regards...

Fabio Dell'Aria.

Dietmar Brueckmann
19-Sep-2005, 12:51 PM
Am Fri, 16 Sep 2005 11:49:11 +0200 schrieb admin:
>
> Can you add a new thread in the suggestion forum newsgroups, please?

Thanks for answering - but because of a project-deadline this week I'll add
it next week after testing the "Other"-Tab-feature.
I think it's necessary to know somthing about it before discuss it.

--
Best regards
Dietmar Brueckmann