finch
finch copied to clipboard
Clear error when finch cannot access a path
What is the problem you're trying to solve?. When finch is instructed to access a path that is outside of one of it's allowed directories, a generic error message is thrown:
time="2023-03-16T09:43:07Z" level=fatal msg="lstat /private/var/folders/zx/d5wln9n10sn0tcj1v9798f1c0000gr/T/jsii-kernel-9VYgrO/node_modules/@aws-cdk/aws-lambda-python-alpha/lib/Containerfile: no such file or directory"
Even when a user is using finch directly, this error does not make a solution clear. It is not the file that is missing, it is access is not allowed. This gets worse when finch is used through other tools like CDK and the user does not actively choose a path (it has been abstracted away for them).
Describe the feature you'd like When finch fails to access a restricted path, the error message should clearly state this:
time="2023-03-16T09:43:07Z" level=fatal msg="private/var/folders/zx/d5wln9n10sn0tcj1v9798f1c0000gr/T/jsii-kernel-9VYgrO/node_modules/@aws-cdk/aws-lambda-python-alpha/lib/Containerfile: finch is not allowed to access this file, please configure additional_directories in finch.yaml to allow access"
Ideally, finch would just prompt the user to allow access and add the path.
Additional context Relevant issues: https://github.com/runfinch/finch/issues/297 https://github.com/aws/aws-cdk/issues/24458#issuecomment-1471631637