Bug #32101 [NoF]: Exception in unknown on line 0 when throwing exception inside exception handler

From: Date: Thu, 25 Mar 2010 20:32:31 +0000
Subject: Bug #32101 [NoF]: Exception in unknown on line 0 when throwing exception inside exception handler
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-149027@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=32101&edit=1

 ID:               32101
 Updated by:       stas@php.net
 Reported by:      ceefour at gauldong dot net
 Summary:          Exception in unknown on line 0 when throwing exception
                   inside exception handler
 Status:           No Feedback
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: *
 PHP Version:      5CVS-2005-02-15

 New Comment:

Maybe related to Bug #51394


Previous Comments:
------------------------------------------------------------------------
[2007-10-30 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2007-10-22 08:48:40] jani@php.net

Does this still happen using latest CVS snapshot/checkout of PHP 5.2
branch?

------------------------------------------------------------------------
[2007-10-22 08:47:25] jani@php.net

See also bug #43016


------------------------------------------------------------------------
[2007-10-18 11:26:41] ceefour at gauldong dot net

You know, "complicated" stack traces like the one you get in Java would
be much more helpful than this message. Or the one in Erlang. Or in Ruby
with Rails.

------------------------------------------------------------------------
[2007-10-18 10:39:04] gerrit dot boettcher at gmail dot com

Got the same Problem with the ErrorHandler
Just in win32. In Linux this works great.

SourceCode:
-------------------------------------------
--- header.php (Load before any output started or other PHP files
loaded)
set_error_handler(array('main','handleError'), E_ALL);

--- main.class.php
final class main {
   [...]
public static function handleError($errorNo, $message, $filename,
$lineNo) {
		$errReport = error_reporting();
		
		if ($errReport != 0) {
			if ($errorNo != 8) {
				$type = 'error';
				switch ($errorNo) {
					case 2: $type = 'warning';
					break;
				}
				
				throw new SystemException('PHP '.$type.' in file '.$filename.'
('.$lineNo.'): '.$message, 0);
			}
		}
	}
   [...]
}

--- systemexception.class.php (loaded before main.class.php)
require_once('exceptions/printableexception.class.php');
class SystemException extends Exception implements PrintableException {
[...]
public function show() {
echo '...[...template...]...';
}
[...]
}

--- printableexception.class.php
interface PrintableException {
public function show();
}
----------- EOF --------------

On Linux Systems: anything works great!
On Windows Systems: Exception thrown without a stack frame in Unknown on
line 0

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=32101


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=32101&edit=1


Thread (13 messages)

« previous php.bugs (#149027) next »