View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
332 | Exception_DefaultHandler | All | public | 1 Feb 2010 18:12 | 27 Feb 2012 21:29 |
Reporter | mrosenquist | Assigned To | timj | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | 0.8.1 | ||||
Target Version | 0.8.2 | Fixed in Version | 0.8.2 | ||
Summary | 332: Allow setting additional debugging data, to be output in the case of errors | ||||
Description | Have a way of setting additional debugging data (not present in the environment or backtrace) that will be output in the error report e-mails Example: current_user => "John Smith (jsmith)" | ||||
Tags | No tags attached. | ||||
Attached Files | Exception_DefaultHandler.bug332.patch (1,521 bytes)
Index: DefaultHandler.php =================================================================== --- DefaultHandler.php (revision 49242) +++ DefaultHandler.php (working copy) @@ -53,6 +53,8 @@ public static $error_page_source = null; + protected static $extra_environment_information = array(); + /* termination errors as specified by "fatal errors" see: http://uk3.php.net/manual/en/errorfunc.constants.php @@ -480,7 +482,23 @@ } } } - + if (count(self::$extra_environment_information)>0) { + $error .= "Additional Information:\n"; + foreach (self::$extra_environment_information as $variable => $value) { + // TODO: Iterate this properly for arrays with >2 dimensions... + if (is_array($value)) { + foreach($value as $array_key => $array_value) { + if (is_scalar($array_value)) { + $error .= $variable . "[$array_key]: $array_value\n"; + } else { + $error .= $variable . "[$array_key]: ". gettype($array_value) . "\n"; + } + } + } else { + $error.= "$variable: $value\n"; + } + } + } return $error; } @@ -692,5 +710,16 @@ return false; } - + + /** + * Function to add extra information to enviorment information, so that it is returned if there is an issue + * + * @param array $info - Additional information + */ + public static function addEnvironmentInformation(array $info) + { + self::$extra_environment_information = array_merge(self::$extra_environment_information, $info); + } + + } | ||||
|
Suggested change to this feature. Rather than add a extra param, have a way of adding information to the environment. See attached |
|
Fixed in SVN r2245 |
Date Modified | Username | Field | Change |
---|---|---|---|
1 Feb 2010 18:12 | mrosenquist | New Issue | |
2 Feb 2010 10:54 | timj | Target Version | => 0.8.1 |
4 Jun 2010 11:24 | timj | Target Version | 0.8.1 => |
30 Sep 2011 09:01 | mrosenquist | Note Added: 391 | |
30 Sep 2011 09:02 | mrosenquist | File Added: Exception_DefaultHandler.bug332.patch | |
14 Oct 2011 20:47 | timj | Category | => All |
19 Oct 2011 17:54 | timj | Assigned To | => timj |
19 Oct 2011 17:54 | timj | Status | new => assigned |
19 Oct 2011 17:54 | timj | Product Version | 0.8.0 => 0.8.1 |
19 Oct 2011 17:54 | timj | Fixed in Version | => 0.8.2 |
19 Oct 2011 17:54 | timj | Target Version | => 0.8.2 |
19 Oct 2011 17:54 | timj | Summary | Add a optional second parameter to handleExceptionManual which takes an associative array of addtional details => Allow setting additional debugging data, to be output in the case of errors |
19 Oct 2011 17:54 | timj | Description Updated | |
20 Oct 2011 17:40 | timj | Note Added: 397 | |
20 Oct 2011 17:40 | timj | Reproducibility | have not tried => N/A |
20 Oct 2011 17:40 | timj | Status | assigned => resolved |
20 Oct 2011 17:40 | timj | Resolution | open => fixed |
27 Feb 2012 21:29 | timj | Status | resolved => closed |