View Issue Details

IDProjectCategoryView StatusLast Update
332Exception_DefaultHandlerAllpublic27 Feb 2012 21:29
Reportermrosenquist Assigned Totimj  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version0.8.1 
Target Version0.8.2Fixed in Version0.8.2 
Summary332: Allow setting additional debugging data, to be output in the case of errors
DescriptionHave 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)"
TagsNo 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);
+	}
+	
+	
 }

Activities

mrosenquist

30 Sep 2011 09:01

reporter   ~391

Suggested change to this feature.

Rather than add a extra param, have a way of adding information to the environment.

See attached

timj

20 Oct 2011 17:40

administrator   ~397

Fixed in SVN r2245

Issue History

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