swifter icon indicating copy to clipboard operation
swifter copied to clipboard

Returns errors from Files helper functions

Open Vkt0r opened this issue 6 years ago • 0 comments

Recently I was helping in #386 with two cases I once I tested the Demo projects they gave me to reproduce the issue I noticed the functions:

  • shareFilesFromDirectory
  • shareFile

Both returns a 404 in case of some error happened during the execution of the function and this is not helpful at all for users trying to figure out a way to see what's happening exactly.

In the two cases I found two different kinds of errors:

  • Operation not permitted
  • No such file or directory

If that errors would have been throw it would be easy to identify the user from the beginning.

So my recommendation gives the option to throw directly in the function or return a custom response with the message of the error instead or the default 404.

Vkt0r avatar May 05 '19 01:05 Vkt0r