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 handling - expected exceptions from cardinality violations #39

Open
jdamick opened this issue Mar 4, 2013 · 1 comment
Open

Comments

@jdamick
Copy link
Contributor

jdamick commented Mar 4, 2013

For the case where an add/remove on the ResourceRecordSetApi fails. The providers need a standard way to express errors that occur that are specific to a particular record type or provider record type.

As an example, in base DNS implementations you can only have 1 CNAME record at a particular label, www. in the case below.

Existing: www.denominator.io CNAME to www1
Then trying to add: www.denominator.io CNAME to www2
This should throw an exception such as:

TargetExistsException (which extends IllegalStateException)

Other implementations may allow this behavior through different provide specific extensions, round-robin answers, "pools", etc. - In this case there may be other errors that would occur, these should also throw TargetExistsException or IllegalStateException as appropriate.

@codefromthecrypt
Copy link
Contributor

+1

As you mentioned, there are extensions that exist, and speaking for
netflix, we use weighted record sets
which violate normal expectations of CNAME. I'm not sure we will continue
using these or not, but since they do exist, let's hesitate before
enforcing client-side rules like how many values a CNAME can have. Your
approach addresses this by suggesting in the case multiple CNAME values
aren't supported on the server, the user should expect a
TargetExistsException.
Perhaps later, we may decide to expose metadata about what a server
supports, but for now, I think your approach of just clarifying (and
testing) which exception folks will receive is the best course.

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