Add full stacktrace to errors list in sync now (#945)

This commit is contained in:
Mikołaj Pich 2020-09-03 21:10:39 +02:00 committed by GitHub
parent 18b9bf42e1
commit debb21f5f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,13 +50,16 @@ class SyncWorker @WorkerInject constructor(
} catch (e: Throwable) {
Timber.w("${work::class.java.simpleName} result: An exception ${e.message} occurred")
if (e is FeatureDisabledException || e is FeatureNotAvailableException) null
else e
else {
Timber.e(e)
e
}
}
}
val result = when {
exceptions.isNotEmpty() && inputData.getBoolean("one_time", false) -> {
Result.failure(Data.Builder()
.putString("error", exceptions.toString())
.putString("error", exceptions.map { it.stackTraceToString() }.toString())
.build()
)
}