Skip to content

Commit 3073b84

Browse files
authored
request error add x-request-id (#1707)
1 parent 3575066 commit 3073b84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/utils/mixin_api_client.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ Client createClient({
5858
serverTimeStamp =
5959
DateTime.fromMicrosecondsSinceEpoch(serverTime ~/ 1000);
6060
}
61-
w('request error ${e.requestOptions.uri}: '
61+
final requestId = e.response?.headers.value('x-request-id') ?? '';
62+
w('request error ${e.requestOptions.uri}, x-request-id = $requestId\n'
6263
'requestTimeStamp = ${requestTimeStamp?.outputFormat()} '
6364
'serverTimeStamp = ${serverTimeStamp?.outputFormat()} '
6465
'now = ${DateTime.now().outputFormat()}');

0 commit comments

Comments
 (0)