Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Change exception text to be more readable #2968

Open
2 tasks done
shayfisher opened this issue Jun 13, 2023 · 1 comment
Open
2 tasks done

Change exception text to be more readable #2968

shayfisher opened this issue Jun 13, 2023 · 1 comment
Labels
confusing-error feature-request This issue requests a feature. needs-discussion p2 This is a standard priority issue

Comments

@shayfisher
Copy link

Describe the feature

After reading this article - https://docs.aws.amazon.com/appstream2/latest/developerguide/access-api-cli-through-interface-vpc-endpoint.html
They have the following example:
appstream2client = boto3.client('appstream',region_name='<aws-region>',endpoint_url='<vpc-endpoint-id>.api.appstream.<aws-region>.vpce.amazonaws.com'
If endpoint url is given for the boto3 appstream client without a schema (HTTPS/HTTP) the following exception is raised (ValueError) -

raise ValueError("Invalid endpoint: %s" % endpoint_url)

which doesn't help the developer understand what should he fix

Use Case

I'm trying to use appstream API via boto3 from Lambda

Proposed Solution

I would suggest adding schema to the error message so it would be clear what is the desired fix -
e.g - raise ValueError("Invalid endpoint: HTTPS/HTTP://%s" % endpoint_url) or something like that

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

1.29.152

Environment details (OS name and version, etc.)

Windows/Linux

@shayfisher shayfisher added feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged. labels Jun 13, 2023
@tim-finnigan tim-finnigan self-assigned this Jun 13, 2023
@tim-finnigan
Copy link
Contributor

Hi @shayfisher thanks for the feature request. Here is the is_valid_endpoint_url function code for reference, and here is where is_valid_ipv6_endpoint_url is defined.

Because there are several conditions that could result in the Invalid endpoint... message, there are some nuances to consider for what the error message should say. I think more discussion is needed to determine what improvements there could be to the error message depending on each condition.

Also in the meantime you could also consider get more detailed logs when debugging by adding boto3.set_stream_logger('') to your script.

@tim-finnigan tim-finnigan removed their assignment Jun 13, 2023
@tim-finnigan tim-finnigan added confusing-error needs-discussion p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jun 13, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
confusing-error feature-request This issue requests a feature. needs-discussion p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants