Skip to content

Commit 52f3201

Browse files
committed
More error details
1 parent e26fa1d commit 52f3201

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

WordPress/src/main/java/org/wordpress/android/ui/newstats/datasource/StatsDataSourceImpl.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,19 @@ class StatsDataSourceImpl @Inject constructor(
158158
)
159159
TopPostsDataResult.Error(result.errorMessage)
160160
}
161+
is WpRequestResult.ResponseParsingError -> {
162+
AppLog.e(
163+
T.STATS,
164+
"StatsDataSourceImpl: fetchTopPostsAndPages ResponseParsingError - " +
165+
"reason=${result.reason}, responseCode=${result.responseCode}, " +
166+
"responseBody=${result.responseBody}"
167+
)
168+
TopPostsDataResult.Error("Response parsing error: ${result.reason}")
169+
}
161170
else -> {
162171
AppLog.e(
163172
T.STATS,
164-
"StatsDataSourceImpl: fetchTopPostsAndPages unexpected result type - ${result::class.simpleName}"
173+
"StatsDataSourceImpl: fetchTopPostsAndPages unexpected result - $result"
165174
)
166175
TopPostsDataResult.Error("Unknown error")
167176
}

0 commit comments

Comments
 (0)