docsforadobe / aequery

MIT License
41 stars 8 forks source link

importFiles errors #25

Open runegan opened 7 years ago

runegan commented 7 years ago

Original report by Rune Gangsø (Bitbucket: runegan, GitHub: runegan).


Currently if an error is thrown when importing multiple files with aeq.project.importFiles the import is stopped and no items, some of which could have been imported successfully, is not returned. I think it would be better to gather the errors, and let all items be imported.

The problem then becomes: what to do with the errors?

My ideal solution would be something where the items that was imported still gets returned, as I probably want to do something with them, but I still get to control what to do with the errors.

Some solutions:

runegan commented 7 years ago

Original comment by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).


I like the Store add an errors attribute to the return array option. This way you still get a standard array of the items, but also have the ability to check errors if you want. Can add in metadata such as errored filename and the file.error info