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

Error details aren't passed through #482

Open
kevinrobayna opened this issue Jun 22, 2023 · 5 comments · May be fixed by #483
Open

Error details aren't passed through #482

kevinrobayna opened this issue Jun 22, 2023 · 5 comments · May be fixed by #483

Comments

@kevinrobayna
Copy link

I see we have cassettes here

string: '{"ok":false,"error":"invalid_arguments","response_metadata":{"messages":["[ERROR]

but the error we get, if something fails, is just invalid_arguments, is this on purpose?

@dblock
Copy link
Collaborator

dblock commented Jun 22, 2023

Do you mean it doesn't include response_metadata? We should, it's not on purpose.

@kevinrobayna
Copy link
Author

Actually, the response metadata is present 😅

I was expecting when printing e that I'd get all the details from the error (instead I was only getting the error message)


        client.views_open(
          view: view,
          trigger_id: request[:trigger_id]
        )
      rescue Slack::Web::Api::Errors::InvalidArguments => e
        puts e # prints invalid_arguments
        puts e.error # prints invalid_arguments
        puts e.response_metadata # prints the error from slack's api
      end

@kevinrobayna
Copy link
Author

Closing since people can get the error details as expected I was just being silly 😅

@dblock
Copy link
Collaborator

dblock commented Jun 23, 2023

We could change to_s to display it.

@kevinrobayna kevinrobayna reopened this Jun 23, 2023
kevinrobayna added a commit to kevinrobayna/slack-ruby-client that referenced this issue Jun 23, 2023
fixes: slack-ruby#482

Currently when we get the error message we get no details of what went
wrong unless we get the response_metadata for the error which is not
intuitive as most people when they get an error and print the exception
they would expect to see as much details as possible.

Additionally updated ruby-version in the project to be the latest as
most people would be using that one as their default, though not
changing the one required by the gem
@kevinrobayna kevinrobayna linked a pull request Jun 23, 2023 that will close this issue
@kevinrobayna
Copy link
Author

yeah! raised a PR for it, let me know your thoughts

#483

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