Re: [PHP] Exceptions

2007-08-10 Thread Richard Lynch
On Thu, August 9, 2007 11:50 am, Peter Pan wrote: I'm having an issue where throwing Exceptions are displaying a blank page even though the Exception is being caught in a try...catch statement. This is happening on our production server where warnings, errors, exceptions, etc. are not to be

[PHP] Exceptions

2007-08-09 Thread Peter Pan
Peeps, I'm having an issue where throwing Exceptions are displaying a blank page even though the Exception is being caught in a try...catch statement. This is happening on our production server where warnings, errors, exceptions, etc. are not to be displayed to the user. The assumption is

Re: [PHP] Exceptions

2007-08-09 Thread Nathan Nobbe
Peter, you are doing something called swallowing the exception. it may make sense for your application to continue processing if the closeCallTracker method throws an error, but at a minimum you should log the details of the exception so that you know why its occurring; something like: try {

Re: [PHP] Exceptions

2007-08-09 Thread Peter Pan
is a great idea, but not realistic given the amount of times this function is called. Thank you for your help! I'll update the list with my findings. -ec From: Nathan Nobbe [EMAIL PROTECTED] To: Peter Pan [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] Exceptions Date: Thu, 9

Re: [PHP] Exceptions: How much is too much.

2007-01-07 Thread Craige Leeder
Thanks. Does anybody else have any input? Not to be pushy, but I'm in the middle of programming a framework for a site. - Craige On 1/5/07, Paul Scott [EMAIL PROTECTED] wrote: On Fri, 2007-01-05 at 00:44 -0500, Craige Leeder wrote: The question is: How much is too much. Should I use

Re: [PHP] Exceptions: How much is too much.

2007-01-07 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-07 13:17:23 -0500: On 1/5/07, Paul Scott [EMAIL PROTECTED] wrote: On Fri, 2007-01-05 at 00:44 -0500, Craige Leeder wrote: The question is: How much is too much. Should I use Exceptions to handle all of my error reporting/triggering? How about catching them? I

[PHP] Exceptions: How much is too much.

2007-01-04 Thread Craige Leeder
PHP Mailing List Listeners, My question to you is about PHP 5's exception handling. I have looked at it for a while, but never REALLY used it. The question is: How much is too much. Should I use Exceptions to handle all of my error reporting/triggering? How about catching them? I mean, if I'm

Re: [PHP] Exceptions: How much is too much.

2007-01-04 Thread Paul Scott
On Fri, 2007-01-05 at 00:44 -0500, Craige Leeder wrote: The question is: How much is too much. Should I use Exceptions to handle all of my error reporting/triggering? How about catching them? I mean, if I'm using Exceptions for all of my error handling, I could easily end up wrapping my

Re: [PHP] Exceptions in PHP

2006-05-15 Thread Kevin Waterson
This one time, at band camp, John Meyer [EMAIL PROTECTED] wrote: I have the following script: try { $conn = mysql_connect(localhost,webuser,testme) or die(Could not connect); -- snipped for sake of sanity -- I think if you wish to push down this path you may wish to look at PDO.

[PHP] Exceptions in PHP

2006-05-14 Thread John Meyer
I have the following script: try { $conn = mysql_connect(localhost,webuser,testme) or die(Could not connect); mysql_select_db(bookcollection,$conn) or die(Could not select database); //first, check to see if there is an author if ($_POST[neworoldauthor] == new) { $sql =

Re: [PHP] Exceptions in PHP

2006-05-14 Thread Jochem Maas
do you know what a php exception is and when/where/what generates them? (if your coming from another language that supports exceptions you may need to adjust your knowledge - php's exceptions are a little different - for instance they are not ever generated by the engine itself) does

Re: [PHP] Exceptions in PHP

2006-05-14 Thread Richard Lynch
, depending on how that big flame-war in Internals work[s|ed] out... You need to do your own 'throw' if you want your 'catch' to execute, almost for sure. Disclaimer: Ain't never used PHP Exceptions, and don't like 'em, so I don't really know what I'm talking about. -- Like Music? http://l-i

[PHP] Re: [PHP-DEV] Re: [PHP] Exceptions: function x throws Exception

2005-08-06 Thread Marcus Boerger
Hello Jochem, lookup the archieves. We have long ago decided agains that. marcus Friday, August 5, 2005, 2:26:04 PM, you wrote: Dear Internals, class FooBar { public function foo() throws Exception {} } function fooFoo() throws Exception {} this came up on php-generals and I

[PHP] Re: [PHP-DEV] Re: [PHP] Exceptions: function x throws Exception

2005-08-06 Thread Jochem Maas
Marcus Boerger wrote: Hello Jochem, lookup the archieves. We have long ago decided agains that. I'll take your word on it. :-) (shame on me for not searching harder before asking) thanks for replying. marcus Friday, August 5, 2005, 2:26:04 PM, you wrote: Dear Internals, class

[PHP] Exceptions: function x throws Exception

2005-08-05 Thread Norbert Wenzel
If there is a class with a function, that might throw exceptions and does NOT catch them, may I write that like in Java? class FooClass { public function foo() throws Exception { } } Or is there another possibility to tell a function throws an exception and to force the

Re: [PHP] Exceptions: function x throws Exception

2005-08-05 Thread Torgny Bjers
Norbert Wenzel wrote: If there is a class with a function, that might throw exceptions and does NOT catch them, may I write that like in Java? class FooClass { public function foo() throws Exception { } } Or is there another possibility to tell a function throws an

Re: [PHP] Exceptions: function x throws Exception

2005-08-05 Thread Norbert Wenzel
Torgny Bjers wrote: The Java way doesn't work here. The best approach would be to simply run a try/catch/finally around the call to your function/method, and inside the function itself you do the following: if (...) { throw new Exception(My message.); } } Hello Torgny, Thanky you for your

Re: [PHP] Exceptions: function x throws Exception

2005-08-05 Thread Jochem Maas
Dear Internals, class FooBar { public function foo() throws Exception {} } function fooFoo() throws Exception {} this came up on php-generals and I wondered if anyone had time/cared to comment if it (as it does to me) seems like a good idea and/or whether it is technically feasable. My

Re: [PHP] Exceptions

2004-07-13 Thread raditha dissanayake
Matthew Sims wrote: Nice, that makes it easier on the eyes to read. --Matthew Sims --http://killermookie.org Matthew's point is probably that you have hijacked a thread - best way to make sure that you DO NOT get an answer to your question. Please read the posting guidlines for this list and

[PHP] Exceptions

2004-07-12 Thread Jason Barnett
public function execute($query) { if (!$this-dbh) { $this-connect(); } // My $query has quotes in it // I try to escape the quotes $query = mysql_escape_string($query); // It causes an error $ret = mysql_query($query, $this-dbh);

Re: [PHP] Exceptions

2004-07-12 Thread Matthew Sims
if (!$ret) { // An Exception error is thrown throw new Exception; } elseif (!is_resource($ret)) { return TRUE; } else { $statment = new DB_MysqlStatement($this-dbh, $query); return $statement; } Fatal

Re: [PHP] Exceptions and builtin functions in PHP5

2004-04-08 Thread daniel
If I understand right, PHP5 has an exception handling mechanism but it is only for manual using, i.e. a programmer can use try/catch but only for own code. PHP's built-in functions and functions from extensions still use old return value method. Yes? -- PHP General Mailing List

Re: [PHP] Exceptions and builtin functions in PHP5

2004-04-08 Thread Tumurbaatar S.
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If I understand right, PHP5 has an exception handling mechanism but it is only for manual using, i.e. a programmer can use try/catch but only for own code. PHP's built-in functions and functions from extensions still use old

RE: [PHP] Exceptions and builtin functions in PHP5

2004-04-08 Thread Hundiak, Arthur
Builtin functions in php5 will not throw exceptions. The basic idea is that exceptions are part of the OOP portion of PHP. What you will need to do is to wrap these functions into classes. Fortunately, many existing class libraries such as PEAR can be tweaked to throw exceptions with little or

Re: [PHP] Exceptions and builtin functions in PHP5

2004-04-08 Thread Greg Beaver
The exception mechanism will not replace trigger_error() or function return values any time soon Greg Tumurbaatar S. wrote: [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If I understand right, PHP5 has an exception handling mechanism but it is only for manual using, i.e. a

[PHP] Exceptions and builtin functions in PHP5

2004-04-07 Thread Tumurbaatar S.
If I understand right, PHP5 has an exception handling mechanism but it is only for manual using, i.e. a programmer can use try/catch but only for own code. PHP's built-in functions and functions from extensions still use old return value method. Yes? -- PHP General Mailing List