支持flutter调用

This commit is contained in:
2025-01-15 09:55:42 +08:00
parent 234d8ea7ca
commit 0fee2d7f69
7 changed files with 88 additions and 17 deletions

View File

@@ -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); // 继续处理错误