Skip to content

Commit a16a8b2

Browse files
committed
send the error object as the message
1 parent fb1a972 commit a16a8b2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"require": {
1111
"php": "^7.2|^8.0",
1212
"yiisoft/yii2": "^2.0",
13-
"sentry/sdk": "^3.0"
13+
"sentry/sdk": "^3.0",
14+
"ext-json": "*"
1415
},
1516
"require-dev": {
1617
"codeception/codeception": "^4.0",

src/SentryTarget.php

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ public function export()
126126
$data['message'] = (string)$text['message'];
127127
unset($text['message']);
128128
}
129+
if (!isset($text['message'])) {
130+
$data['message'] = json_encode($text);
131+
}
129132

130133
if (isset($text['tags'])) {
131134
$data['tags'] = ArrayHelper::merge($data['tags'], $text['tags']);

0 commit comments

Comments
 (0)