Re: Try{} Catch()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's not supposed to be practical, it's just a way to handle errors. You
shouldn't rely on try/catch for algorithm implementation.

You create exceptions for errors and unexpected behavior. Then in some other
part of the system you use try/catch to prevent the code from terminating
abruptly. You catch the exception (you should know which exceptions can be
thrown), and act accordingly. Either closing resources, add a log message
with debug information, and/or sending an error message to the user.

2007/12/23, Al <news@xxxxxxxxxxxxx>:
>
> Try() and Catch() seems neat; but, I've not found it to be very practical.
>
> Anyone using it? How?
>
> Al...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux