aseprite/api

Link To app.fs In Docs For Objects That Can Be Constructed From File Paths

Opened this issue · 0 comments

Hi again,

This is a feature request.

For objects that can be constructed from file paths -- such as ColorSpaces, Sprites and Palettes -- I think it would be helpful to mention and to link to app.fs, specifically this section. This gives readers a heads up for how they can get greater flexibility over error handling, such as when a file path is invalid. I was messing around pcall and xpcall with inconsistent results before remembering app.fs. I'm still using xpcall for palettes loaded from presets (this is in Aseprite v. 1.3beta-6).

Alternatively, a more dramatic revision would be to remove constructors that accept file paths. Loading functions can then be shifted to app.fs, where it is clearer that an error may be raised, nil may be returned and more functionality for error handling can be provided.

Thank you for considering.
Best,
Jeremy