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

[FEATURE] Respond to api requests when YAML validation fails #25

Closed
brooksmtownsend opened this issue Aug 1, 2022 · 1 comment
Closed
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@brooksmtownsend
Copy link
Member

When I submit invalid YAML to wadm, I get timeout errors from the client, but in the wadm logs we have:

14:01:31.917 [error] Gnat.Server encountered an error while handling a request: %Protocol.UndefinedError{description: "", protocol: String.Chars, value: %YamlElixir.ParsingError{column: 9, line: 104, message: "Invalid sequence", type: :not_a_sequence}}
14:02:27.411 [error] Gnat.Server encountered an error while handling a request: %Protocol.UndefinedError{description: "", protocol: String.Chars, value: %YamlElixir.ParsingError{column: 9, line: 104, message: "Invalid sequence", type: :not_a_sequence}}
14:03:00.468 [error] Gnat.Server encountered an error while handling a request: %Protocol.UndefinedError{description: "", protocol: String.Chars, value: %YamlElixir.ParsingError{column: 19, line: 105, message: "Block mapping value not allowed here", type: :block_mapping_value_not_allowed}}

These happen quickly and should result in a YAML parsing error and not a timeout, this could just be modifying the API server flow for model put https://github.com/wasmCloud/wadm/blob/main/wadm/lib/wadm/api/api_server.ex#L121 so that requests that fail validation return an error instead of panicking

@brooksmtownsend brooksmtownsend added enhancement New feature or request good first issue Good for newcomers labels Aug 1, 2022
@brooksmtownsend
Copy link
Member Author

Closing as this is no longer applicable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant