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

Allow String keys to be set for error messages #1061

Open
jwoertink opened this issue Aug 21, 2024 · 0 comments
Open

Allow String keys to be set for error messages #1061

jwoertink opened this issue Aug 21, 2024 · 0 comments

Comments

@jwoertink
Copy link
Member

def add_error(key : Symbol, message : String) : Nil

I have a case where I get errors back from an API JSON. I want to pass those along in the error messages, but I can't just add_error(err["key"].as_s, err["val"].as_s), and there's no way to convert JSON to Symbol, or a String to a Symbol.

The big issue here is that it becomes a major breaking change to allow both Symbol and String. I'm not sure what the solution is here, but we should definitely make this more flexible.

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

No branches or pull requests

1 participant