diff options
author | Nikita Popov <nikic@php.net> | 2015-05-17 18:35:18 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2015-05-17 18:47:06 +0200 |
commit | 3ae995f03c8f60c4a4c9718262545cf5a6a08da3 (patch) | |
tree | 09057b4ca7235be04e6ee763c11f46aba738e41b /Zend/zend_exceptions.c | |
parent | 0df2f470fa194b28f1eb9e5788b8cf4c3f03f5f7 (diff) | |
download | php-git-3ae995f03c8f60c4a4c9718262545cf5a6a08da3.tar.gz |
Tweak uncaught exception message display
This implements a reduced variant of #1226 with just the following
change:
-Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d
+Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d
The '' wrapper around messages is very weird if the exception
message itself contains ''. Futhermore having the message wrapped
in '' doesn't work for the "and defined" suffix of
TypeExceptions.
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r-- | Zend/zend_exceptions.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 671c09cd60..94a51cf1ef 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -653,13 +653,13 @@ ZEND_METHOD(exception, __toString) } if (message->len > 0) { - str = zend_strpprintf(0, "exception '%s' with message '%s' in %s:" ZEND_LONG_FMT + str = zend_strpprintf(0, "%s: %s in %s:" ZEND_LONG_FMT "\nStack trace:\n%s%s%s", Z_OBJCE_P(exception)->name->val, message->val, file->val, line, (Z_TYPE(trace) == IS_STRING && Z_STRLEN(trace)) ? Z_STRVAL(trace) : "#0 {main}\n", prev_str->len ? "\n\nNext " : "", prev_str->val); } else { - str = zend_strpprintf(0, "exception '%s' in %s:" ZEND_LONG_FMT + str = zend_strpprintf(0, "%s in %s:" ZEND_LONG_FMT "\nStack trace:\n%s%s%s", Z_OBJCE_P(exception)->name->val, file->val, line, (Z_TYPE(trace) == IS_STRING && Z_STRLEN(trace)) ? Z_STRVAL(trace) : "#0 {main}\n", |