@@ -56,13 +56,13 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
56
56
if ($ traceId = TracerContext::getTraceId ()) {
57
57
$ response = $ response ->withHeader ('Trace-Id ' , $ traceId );
58
58
}
59
- $ span ->setTag ($ this ->spanTagManager ->get ('response ' , 'status_code ' ), $ response ->getStatusCode ());
59
+ $ span ->setTag ($ this ->spanTagManager ->get ('response ' , 'status_code ' ), ( string ) $ response ->getStatusCode ());
60
60
} catch (Throwable $ exception ) {
61
61
if ($ this ->switchManager ->isEnable ('exception ' ) && ! $ this ->switchManager ->isIgnoreException ($ exception )) {
62
62
$ this ->appendExceptionToSpan ($ span , $ exception );
63
63
}
64
64
if ($ exception instanceof HttpException) {
65
- $ span ->setTag ($ this ->spanTagManager ->get ('response ' , 'status_code ' ), $ exception ->getStatusCode ());
65
+ $ span ->setTag ($ this ->spanTagManager ->get ('response ' , 'status_code ' ), ( string ) $ exception ->getStatusCode ());
66
66
}
67
67
throw $ exception ;
68
68
} finally {
@@ -76,7 +76,7 @@ protected function appendExceptionToSpan(Span $span, Throwable $exception): void
76
76
{
77
77
$ span ->setTag ('error ' , true );
78
78
$ span ->setTag ($ this ->spanTagManager ->get ('exception ' , 'class ' ), get_class ($ exception ));
79
- $ span ->setTag ($ this ->spanTagManager ->get ('exception ' , 'code ' ), $ exception ->getCode ());
79
+ $ span ->setTag ($ this ->spanTagManager ->get ('exception ' , 'code ' ), ( string ) $ exception ->getCode ());
80
80
$ span ->setTag ($ this ->spanTagManager ->get ('exception ' , 'message ' ), $ exception ->getMessage ());
81
81
$ span ->setTag ($ this ->spanTagManager ->get ('exception ' , 'stack_trace ' ), (string ) $ exception );
82
82
}
0 commit comments