Skip to content

Commit 9c52aef

Browse files
committed
Merge branch 'tracing-appender-name-metadata' of github.com:lalitb/opentelemetry-rust into tracing-appender-name-metadata
2 parents 3b0eb12 + dff46ad commit 9c52aef

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

opentelemetry-otlp/src/lib.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,17 @@ impl From<tonic::Status> for Error {
381381
code: status.code(),
382382
message: {
383383
if !status.message().is_empty() {
384-
", detailed error message: ".to_string() + status.message()
384+
let mut result = ", detailed error message: ".to_string() + status.message();
385+
if status.code() == tonic::Code::Unknown {
386+
let source = (&status as &dyn std::error::Error)
387+
.source()
388+
.map(|e| format!("{:?}", e));
389+
result.push(' ');
390+
result.push_str(source.unwrap_or_default().as_ref());
391+
}
392+
result
385393
} else {
386-
"".to_string()
394+
String::new()
387395
}
388396
},
389397
}

0 commit comments

Comments
 (0)