can a Try Catch work within a Catch
i've got a try catch in the framework i'm using which when the catch is
triggered it displays an error report page, one thing in this report page
is that it displays a menu where the times came from the database
what i thought it's do is that i'd put another try catch in the catch in
case if the database can be connected to, something like this
try
{
code that would throw an excpetion
}
catch(Exception $e)
{
try
{
connect to database
run query
log error in database
output screen using database data
}
catch(Exception $e)
{
output screen using static html
}
}
this way if the exception was a database connection error it will use a
static html output rather than the dynamic one generated from database
data
however when i cause a database error (deleting a required table) my
static html doesn't work
i am wondering if it is even possible for a try catch to work in the catch
or weather it's the framework (i'm using magento)
No comments:
Post a Comment