File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public function export(Span $span): void
5151 $ ch = curl_init ($ this ->endpoint );
5252
5353 if ($ ch === false ) {
54+ error_log ('Sentry exporter: Failed to initialize curl ' );
5455 return ;
5556 }
5657
@@ -66,7 +67,18 @@ public function export(Span $span): void
6667 CURLOPT_CONNECTTIMEOUT_MS => 500 ,
6768 ]);
6869
69- curl_exec ($ ch );
70+ $ result = curl_exec ($ ch );
71+
72+ if ($ result === false ) {
73+ error_log ('Sentry exporter: ' . curl_error ($ ch ));
74+ } else {
75+ $ statusCode = curl_getinfo ($ ch , CURLINFO_HTTP_CODE );
76+ if ($ statusCode >= 400 ) {
77+ error_log ("Sentry exporter: HTTP {$ statusCode } - {$ result }" );
78+ }
79+ }
80+
81+ curl_close ($ ch );
7082 }
7183
7284 private function buildEnvelope (Span $ span ): ?string
You can’t perform that action at this time.
0 commit comments