Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
1 registered (Telly), 24 Guests and 15 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 05/17/12
Posts: 3
Top Posters (30 Days)
Ruben 50
DennyP 24
Gizmo 24
Dunny 17
SteveS 14
AllenAyres 12
dbremer 10
SD 9
drkknght00 9
driv 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Topic Options
#136620 - 05/14/99 04:42 AM &pretty_error('sql',0);
Anonymous
Unregistered

I got into a habit on my programs of doing something like this:

<code>
$sth = $dbh->prepare($sql);
if (! $sth->execute) {
     $sth->finish;
     &error_out('sql',0);
}

.... now $sth->fetchrow without worries

sub error_out {
     my ($ctgy, $num) = @_;
     $error_msgs = { 'sql' => [q!Failed to Execute SQL!,q!blah blah blah!],
                     'auth' => [q!Bad User/Pass!],
     };
.... display error header, message, footer, mailto's .. etc.. then exit properly
</code>

With a nice neat anon-hash-of-arrays, it's easy to error out gracefully in the browser window. I just got really sick of my default Apache 500 error..

<h3>So - in english: Replace 500 Server errors with HTML ones..</h3>
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."



Moderator:  AllenAyres, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Ability to "like" individual posts (not Facebook "likes)
by doug
Today at 09:03 AM
Island Permissions
by ThreadsUser
Yesterday at 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Custom forum permissions
by ntdoc
05/18/12 02:07 PM
Forum Stats
10488 Members
36 Forums
33835 Topics
181687 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image