支持flutter调用
This commit is contained in:
@@ -52,8 +52,8 @@ class TraceDio {
|
||||
},
|
||||
onError: (DioException e, handler) {
|
||||
// 记录错误日志
|
||||
String? traceId = e.response?.headers.value('X-Trace-ID');
|
||||
String? spanId = e.response?.headers.value('X-Span-ID');
|
||||
String? traceId = e.requestOptions.headers['X-Trace-ID'];
|
||||
String? spanId = e.requestOptions.headers['X-Span-ID'];
|
||||
_logger.error('Request failed: ${e.message}',
|
||||
tag: "DIO", traceId: traceId, spanId: spanId);
|
||||
return handler.next(e); // 继续处理错误
|
||||
|
||||
Reference in New Issue
Block a user