-
Notifications
You must be signed in to change notification settings - Fork 4k
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
region-info Fact.find() should throw exception if fact not found #3194
Comments
Hi @chelma-amzn, thank you for submitting this request! This seems totally reasonable, and not too difficult to implement. If you would like to submit a PR one of us will review it, otherwise someone will update this issue when there is further information! |
* Throw exception when no fact is found given a region, and fact name. closes aws#3194
* Throw exception when no fact is found given a region, and fact name. closes aws#3194
* Throw exception when no fact is found given a region, and fact name. closes aws#3194
* Throw exception when no fact is found given a region, and fact name. closes aws#3194
* Throw exception when no fact is found given a region, and fact name. closes aws#3194
@chelma-amzn Posted a question in the glitter group, but are we trying to define a second method that will throw, or have this original method throw? |
* New method that throws an exception when the Fact value, given a name and region, are not found. closes aws#3194
* New method that throws an exception when the Fact value, given a name and region, are not found. closes aws#3194
* New method that throws an exception when the Fact value, given a name and region, are not found. closes aws#3194
* New method that throws an exception when the Fact value, given a name and region, are not found. closes #3194
* New method that throws an exception when the Fact value, given a name and region, are not found. closes aws#3194
I'm submitting a ...
What is the current behavior?
If the current behavior is a πͺ²bugπͺ²: Please provide the steps to reproduce
The current behavior is that when a user uses the @aws-cdk/region-info's Fact.find() method, it may return an undefined result. This forces users to perform further checking if they want to pass the result to their own code.
`
const fact = Fact.find(...); // type string?
if (!fact) throw new Error('fact must be provided');
// here fact has type string
`
The Fact class should define a method that throws an exception if the fact is not found.
This enables users to avoid boilerplate code.
N/A
The text was updated successfully, but these errors were encountered: