Skip to content

The file list tome doesn't do input validation. #425

@hulto

Description

@hulto

Describe the bug
Right now if you pass a bad path to file list it will try and run and return a rust error.
We should be proactive and prevent these errors returning helpful errors at the eldritch level first.

Add a check to make sure the path exists.
If it doesn't return a more helpful error from eldritch.

------------[ERROR]----
[eldritch] Eldritch eval_module failed:
Traceback (most recent call last):
  * 21474836798:11, in <module>
      file_list(input_params['path'])
  * 21474836798:2, in file_list
      files = file.list(path)
error: Failed to get file list: No such file or directory (os error 2)
 --> 21474836798:2:13
  |
2 |     files = file.list(path)
  |             ^^^^^^^^^^^^^^^
  |

--------

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions