Skip to content

Commit

Permalink
Use logError for logging errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarta committed Jan 9, 2025
1 parent f44a3f4 commit 8d66697
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.os.Handler
import android.os.Looper
import android.view.PixelCopy
import android.view.View
import dev.hotwire.navigation.logging.logError
import dev.hotwire.navigation.logging.logEvent
import dev.hotwire.navigation.views.HotwireView
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand Down Expand Up @@ -75,7 +76,7 @@ internal class HotwireViewScreenshotHolder {
continuation.resume(bitmap, null)
}
} else {
logEvent("viewScreenshotFailed", listOf("error" to result))
logError("viewScreenshotFailed", Exception("PixelCopy failed with result $result"))
if (continuation.isActive) {
continuation.resume(null, null)
}
Expand All @@ -84,7 +85,7 @@ internal class HotwireViewScreenshotHolder {
Handler(Looper.getMainLooper())
)
} catch (exception: Exception) {
logEvent("viewScreenshotFailed", listOf("error" to exception))
logError("viewScreenshotFailed", exception)
if (continuation.isActive) {
continuation.resume(null, null)
}
Expand Down

0 comments on commit 8d66697

Please sign in to comment.