Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error when the component wasm does not exist #1395

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Apr 16, 2023

We should probably be validating the component source path when we parse the spin.toml file, but this at least makes sure that the error from spin trigger is more understandable when the wasm component does not exist.

Before

Error: Failed to instantiate component 'todo'

Caused by:
    0: loader error: No such file or directory (os error 2)
    1: No such file or directory (os error 2)

After

Error: Failed to instantiate component 'todo'

Caused by:
    0: failed to read component source from disk at path '/Users/rylev/Code/fermyon/todo/target/wam32-wasi/release/todo.wasm'
    1: No such file or directory (os error 2)

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, we have fixed this SO MANY TIMES, and it feels like it keeps going backwards. Thank you for the catch and the fix.

Longer term, we clearly need tests around this and other missing-file scenarios, otherwise this will go back again in six months' time. Not a blocker for this PR though.

Copy link
Contributor

@fibonacci1729 fibonacci1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rylev rylev merged commit 075d397 into main Apr 17, 2023
@rylev rylev deleted the improve-error-no-source branch April 17, 2023 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants