[Errors] Add request body in error reporting.

This commit is contained in:
Kuba Szczodrzyński 2020-02-13 09:57:59 +01:00
parent bfbc0861df
commit 2e0c6fa6a5

View File

@ -72,7 +72,7 @@ class ApiError(val tag: String, var errorCode: Int) {
fun toReportableError(context: Context): ErrorReportRequest.Error { fun toReportableError(context: Context): ErrorReportRequest.Error {
val requestString = request?.let { val requestString = request?.let {
it.method() + " " + it.url() + "\n" + it.headers() it.method() + " " + it.url() + "\n" + it.headers() + "\n\n" + (it.jsonBody()?.toString() ?: "") + (it.textBody() ?: "")
} }
val responseString = response?.let { val responseString = response?.let {
if (it.parserErrorBody == null) { if (it.parserErrorBody == null) {