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

Wrong/unhelpful error provided when using --layout with invalid yaml #1411

Closed
bigbass1997 opened this issue May 10, 2022 · 1 comment · Fixed by #1413
Closed

Wrong/unhelpful error provided when using --layout with invalid yaml #1411

bigbass1997 opened this issue May 10, 2022 · 1 comment · Fixed by #1413
Assignees

Comments

@bigbass1997
Copy link
Contributor

zellij --version: 0.29.1
tput lines: 78
tput cols: 315
uname -av: Linux BassNet 5.15.7-051507-generic #202112081053-Ubuntu SMP Wed Dec 8 11:10:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Say that we have an invalid layout file saved at ~/.config/zellij/layouts/test.yaml with contents:

foo

(contents could be anything; such as a very complex layout with just a simple syntax error)

If we try to use this file like so: zellij --layout-path ~/.config/zellij/layouts/test.yaml, we get an error as expected:

Deserialization error: invalid type: string "foo", expected struct LayoutFromYamlIntermediate at line 1 column 1

However, if we use the same file like this: zellij --layout test.yaml, we get this error:

IoError: The layout was not found, File: test.yaml

While it is technically true that a valid layout was not found, this is also the same error that you'd get if the file simply didn't exist. And in this case the file does exist, zellij just failed to parse it. It would be much more helpful if the deserialization error was given instead of IoError.

@jaeheonji
Copy link
Member

Good Point! I seem to know the problem with this. I will fix it soon. Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants