Skip to content

Returns errors from Files helper functions #407

@Vkt0r

Description

@Vkt0r

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions