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

Getting properties throws NullReferenceException #71

Closed
peschkaj opened this issue Feb 6, 2013 · 3 comments
Closed

Getting properties throws NullReferenceException #71

peschkaj opened this issue Feb 6, 2013 · 3 comments

Comments

@peschkaj
Copy link
Contributor

peschkaj commented Feb 6, 2013

When getting properties on an incorrectly named bucket, CorrugatedIron throws a NullReferenceException. Riak is returning a 404. CorrugatedIon should return a more polite error message instead of falling down and crying.

RiakBucketProperties bucketProperties = new RiakBucketProperties();
bucketProperties.SetNVal(4);
bucketProperties.SetSearch(true);
bucketProperties.SetAllowMultiple(true);
bucketProperties.SetWVal("all");
bucketProperties.SetRVal("quorum");
if (!client.SetBucketProperties("buyseasons/products", bucketProperties).IsSuccess)
{
    Console.WriteLine("Setting bucket properties failed");
}
// boom goes the dynamite
RiakResult<RiakBucketProperties> riakBuckpropertiesResult = client.GetBucketProperties("buyseasons/products", true);
@ghost ghost assigned OJ Feb 7, 2013
OJ added a commit that referenced this issue Feb 7, 2013
* Now prevent users from get/set props when buckets have slashes
  in the name.
* Be more defensive when reading properties out of JSON when loading
  extended props.
* URL encode buckets through HTTP calls.
* Prevent HTTP 400s from pulling nodes out of the pool.
@OJ
Copy link
Contributor

OJ commented Feb 8, 2013

It's worth noting that this changeset includes code which deliberately stops bucket property setting and getting if the bucket contains a forward slash. URL encoding this doesn't have any affect on the issue, so there's no point in relying on that.

Instead, we just reject it and say it's invalid. If we don't, then the interaction with Riak is not what you would expect. Hence this is why I decided to do this.

Thoughts?

@peschkaj
Copy link
Contributor Author

peschkaj commented Feb 8, 2013

worksforme


Jeremiah Peschka - Founder, Brent Ozar Unlimited
MCITP: SQL Server 2008, MVP
Cloudera Certified Developer for Apache Hadoop

On Thu, Feb 7, 2013 at 5:21 PM, OJ Reeves notifications@github.com wrote:

It's worth noting that this changeset includes code which deliberately
stops bucket property setting and getting if the bucket contains a forward
slash. URL encoding this doesn't have any affect on the issue, so there's
no point in relying on that.

Instead, we just reject it and say it's invalid. If we don't, then the
interaction with Riak is not what you would expect. Hence this is why I
decided to do this.

Thoughts?


Reply to this email directly or view it on GitHubhttps://github.com//issues/71#issuecomment-13272383.

@OJ
Copy link
Contributor

OJ commented Feb 8, 2013

OK, I might just close this issue then. We'll get this out in the next release.

@OJ OJ closed this as completed Feb 8, 2013
taliesins pushed a commit to taliesins/CorrugatedIron that referenced this issue Sep 1, 2013
@peschkaj peschkaj unassigned OJ Jun 30, 2014
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