Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

[mob] Log dio response body

Neeraj Gupta0f4027e0d0ba
diff --git a/mobile/apps/photos/lib/core/error-reporting/super_logging.dart b/mobile/apps/photos/lib/core/error-reporting/super_logging.dart
index d584a8c586..3ea0e7aa18 100644
--- a/mobile/apps/photos/lib/core/error-reporting/super_logging.dart
+++ b/mobile/apps/photos/lib/core/error-reporting/super_logging.dart
@@ -48,14 +48,19 @@ extension SuperLogRecord on LogRecord {
if (error != null) {
if (error is DioException) {
- final String? id = (error as DioException)
- .requestOptions
- .headers['x-request-id'] as String?;
+ final e = error as DioException;
+ final String? id = e.requestOptions.headers['x-request-id'] as String?;
if (id != null) {
- msg += "\n⤷ id: $id";
+ msg += "\n⤷ id: $id ";
}
+ if (e.response?.data != null) {
+ msg += "\n⤷ type: ${e.type}\n⤷ error: ${e.response?.data}";
+ } else {
+ msg += "\n⤷ type: ${e.type}\n⤷ error: $error";
+ }
+ } else {
+ msg += "\n⤷ type: ${error.runtimeType}\n⤷ error: $error";
}
- msg += "\n⤷ type: ${error.runtimeType}\n⤷ error: $error";
}
if (stackTrace != null) {
msg += "\n⤷ trace: $stackTrace";