cashapp / paparazzi

Render your Android screens without a physical device or emulator
https://cashapp.github.io/paparazzi/
Apache License 2.0
2.28k stars 214 forks source link

Improve error message when snapshot file read fails #1344

Closed Egorand closed 6 months ago

Egorand commented 6 months ago

Fixes #1343.

Stack trace example:

java.lang.NullPointerException: Failed to read the snapshot file.

    If your project uses git LFS, it's possible that it's misconfigured on your machine and
    Paparazzi is trying to load a pointer file instead of the real snapshot file. Follow git
    LFS troubleshooting instructions and try again.
        at app.cash.paparazzi.SnapshotVerifier$newFrameHandler$1.handle(SnapshotVerifier.kt:49)
        at app.cash.paparazzi.PaparazziSdk$takeSnapshots$1$3.invoke(PaparazziSdk.kt:324)
        at app.cash.paparazzi.PaparazziSdk$takeSnapshots$1$3.invoke(PaparazziSdk.kt:311)
        at app.cash.paparazzi.PaparazziSdk.withTime(PaparazziSdk.kt:359)
        at app.cash.paparazzi.PaparazziSdk.takeSnapshots(PaparazziSdk.kt:311)
        at app.cash.paparazzi.PaparazziSdk.snapshot(PaparazziSdk.kt:199)
        at app.cash.paparazzi.Paparazzi.snapshot(Paparazzi.kt:104)
        at app.cash.paparazzi.Paparazzi.snapshot$default(Paparazzi.kt:102)
        at com.squareup.cash.blockers.views.PasscodeViewTest.default(PasscodeViewTest.kt:61)