Open runegan opened 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
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:
{ items, errors }
errors
attribute to the return arrayif ( item instanceof Error )
for all items the array before doing what you intend.