It would be really great if Devel could support its backtrace handling for exceptions just like errors as it is very difficult to debug core exceptions like "EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7406 of /includes/common.inc)." without having to temporarily hack core and add a manual ddebug_backtrace() before the exception is thrown.

Comments

salvis’s picture

Yes, definitely, but I'm not aware of any possibility to do that at the PHP level. Xdebug does it...

Let us know if you know more...

dave reid’s picture

It's very possible. Instead of set_error_handler() you use set_exception_handler().

salvis’s picture

Ah, yes, I was confused about http://php.net/manual/en/function.set-error-handler.php:

The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.

andrewbelcher’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new5.65 KB

This would be really handy - how about this as a patch to support it?

salvis’s picture

Status: Needs review » Needs work

A late thank you for your patch, andrewbelcher!

Too bad no one was interested in reviewing it in time...