summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-14 15:07:33 +0100
committerGitHub <noreply@github.com>2017-11-14 15:07:33 +0100
commit16549ae5fbc2165ab6cf0a1004f80cd142993d48 (patch)
treee9d74085ac0e05e9bea6278339fe2c1f67ae8830 /lib
parent6d1d2dde0b56b8cc16855599628493bd5cfc9c4d (diff)
parentf6ef3b646457c1194e3550fdf2cd14a839ee273a (diff)
downloadnextcloud-server-16549ae5fbc2165ab6cf0a1004f80cd142993d48.tar.gz
nextcloud-server-16549ae5fbc2165ab6cf0a1004f80cd142993d48.zip
Merge pull request #7166 from nextcloud/enhancement/crash-report-context
Pass the exception context to the crash reporter
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Log.php2
-rw-r--r--lib/private/Support/CrashReport/Registry.php6
-rw-r--r--lib/public/Support/CrashReport/IRegistry.php3
-rw-r--r--lib/public/Support/CrashReport/IReporter.php3
4 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php
index 6b97a3a028e..a41c728df0d 100644
--- a/lib/private/Log.php
+++ b/lib/private/Log.php
@@ -352,7 +352,7 @@ class Log implements ILogger {
$msg .= ': ' . json_encode($data);
$this->log($level, $msg, $context);
if (!is_null($this->crashReporters)) {
- $this->crashReporters->delegateReport($exception);
+ $this->crashReporters->delegateReport($exception, $context);
}
}
diff --git a/lib/private/Support/CrashReport/Registry.php b/lib/private/Support/CrashReport/Registry.php
index bdf18b492fd..670cea3da0e 100644
--- a/lib/private/Support/CrashReport/Registry.php
+++ b/lib/private/Support/CrashReport/Registry.php
@@ -45,10 +45,12 @@ class Registry implements IRegistry {
* Delegate crash reporting to all registered reporters
*
* @param Exception|Throwable $exception
+ * @param array $context
*/
- public function delegateReport($exception) {
+ public function delegateReport($exception, array $context = []) {
+ /** @var IReporter $reporter */
foreach ($this->reporters as $reporter) {
- $reporter->report($exception);
+ $reporter->report($exception, $context);
}
}
diff --git a/lib/public/Support/CrashReport/IRegistry.php b/lib/public/Support/CrashReport/IRegistry.php
index 66c527092bb..62432c782ab 100644
--- a/lib/public/Support/CrashReport/IRegistry.php
+++ b/lib/public/Support/CrashReport/IRegistry.php
@@ -43,6 +43,7 @@ interface IRegistry {
*
* @since 13.0.0
* @param Exception|Throwable $exception
+ * @param array $context
*/
- public function delegateReport($exception);
+ public function delegateReport($exception, array $context = []);
}
diff --git a/lib/public/Support/CrashReport/IReporter.php b/lib/public/Support/CrashReport/IReporter.php
index 03c4f47e3b2..4700f275df4 100644
--- a/lib/public/Support/CrashReport/IReporter.php
+++ b/lib/public/Support/CrashReport/IReporter.php
@@ -35,6 +35,7 @@ interface IReporter {
*
* @since 13.0.0
* @param Exception|Throwable $exception
+ * @param array $context
*/
- public function report($exception);
+ public function report($exception, array $context = []);
}