pd-rs / crankstart

A barely functional, wildly incomplete and basically undocumented Rust crate whose aim is to let you write Games for the Playdate handheld gaming system in Rust.
MIT License
235 stars 24 forks source link

Call geterr() to return FileSystem error strings #10

Closed adamsoutar closed 2 years ago

adamsoutar commented 2 years ago

When a FileSystem call errors on Playdate, we can call geterr() to get a reason string for the failure.

This PR returns that reason within the errors from the FileSystem struct, so instead of just "Error -1", you can log something more like:

image 1

(it also fixes a small typo where errors in seek would say Error from write)

I hope this is helpful. Do let me know if there's something wrong with the code, like if it's not in your preferred style :)

rtsuk commented 2 years ago

LGTM!