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

C# client returns unhelpful exception message when URL is incorrect #904

Open
nicdillon opened this issue Apr 25, 2023 · 3 comments
Open

Comments

@nicdillon
Copy link

Bug Report

Version

0.83.1

Platform

Windows 64-bit, Azure Function App

Description

While testing changes to our Azure Function App that utilizes the Svix C# client, we began getting 404 errors trying to send messages. After much headache, we realized the issue was that the URL we had provided to the client had a "/" at the end (https://api.us.svix.com/). The message returned by the client simply stated the following: "Error calling CreateMessageApiV1AppAppIdMsgPost:", with no other indication of what might be going on.

It might be helpful to include more specific information after the colon, indicating that the provided URL is causing issues when making calls to the API.

@tasn
Copy link
Member

tasn commented Apr 25, 2023

Thanks for the report!

One thing worth noting: you don't need to actually set a URL, it's automatically done by the libs based on the auth token. Though this is a good point about URL normalization and error messages!

@nicdillon
Copy link
Author

nicdillon commented Apr 25, 2023

@tasn thank you for the quick response!

I saw that the URL is optional in the documentation, but in implementation, it appeared to be required for the SvixOptions class, which is required for the SvixClient. Perhaps I missed something in the documentation outlining a different way of creating the client that didn't require the SvixOptions as a parameter.

@tasn
Copy link
Member

tasn commented Apr 25, 2023

That's not good, thanks for the report! :)

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

2 participants