[ic] Displaying SQL-Errors in the Administration Panel
Mike Heins
mike at perusion.com
Sat Jul 12 01:49:06 EDT 2003
Quoting Mike Heins (mike at perusion.com):
> Quoting Stefan Hornburg (Racke) (racke at linuxia.de):
> > > > Isn't it possible, that all SQL-Errors are displayed in the
> > > > administration-panel? That's what I thougt should be the default! I
> > > > use IC v.4.9.7.
> > > >
> > >
> > > I believe you are right. I have been ignoring this issue for
> > > some time, but will be fixing it soon.
> > >
> > > For the moment, you have to look at the global error.log file. Ugh.
> > >
> >
> > As long as there is no Internal Server Error, these messages can be
> > found in the catalog error log, but a feedback for the user is really
> > a good idea.
> >
>
> I am working on it now. There is some question in my mind as to
> what should be done on an error, and my inclination is to do this:
>
> 1. Set up logging levels on a per-table basis, with
> defaults that can be set with DatabaseDefault:
>
> DatabaseDefault LOG_ERROR_CATALOG 1
> DatabaseDefault LOG_ERROR_SESSION 1
> DatabaseDefault LOG_ERROR_GLOBAL 0
> DatabaseDefault DIE_ERROR 0
>
> 2. Log errors to the catalog error.log by default.
>
> Database inventory LOG_ERROR_CATALOG 0|1*
>
> 3. Log errors to the session always if an admin, and
> controlled by configuration if not.
>
> Database inventory LOG_ERROR_SESSION 0|1*
>
> This would have the effect of giving a big red error message
> when such an event as failing to create a record occured. In
> most cases, you would be able to use the <-Back button and
> fix the error and resubmit.
>
> 4. Die at the page level (500 error) only if that is explicit
> request in config for that table:
>
> Database inventory DIE_ERROR 0*|1
>
> 5. Log errors globally only on explicit request:
>
> Database inventory LOG_ERROR_GLOBAL 0*|1
>
> 6. LENGTH_EXCEPTION errors would go into warnings if they
> are handled with truncate.
>
> * default
>
This is done in CVS now, pretty much as shown. You can also get
an error message back in embedded Perl:
my $db = $Db{products};
my $ary = $db->query("select foo from products")
or die $db->errstr;
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.513.523.7621 <mike at perusion.com>
Fast, reliable, cheap. Pick two and we'll talk. -- unknown
More information about the interchange-users
mailing list