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

Better error messages using ListObjects than using HeadBucket. Might … #2892

Merged
merged 1 commit into from
Jun 20, 2017

Conversation

AndriMar
Copy link
Contributor

…be a bigger request but messages are better than BadRequest, how this changes effect the messages:
Before:
If you put some random bucket name that does not exist it gives you 'NotFound'.
But if it does exist but you put the wrong region it gives you 'BadRequest'.
After:
If the bucket dose not exist we get:
Error initializing storage of type s3: unable to access bucket 'my-vault-secrets2' in region us-east-1: NoSuchBucket: The specified bucket does not exist status code: 404
If it is the wrong region we get:
Error initializing storage of type s3: unable to access bucket 'my-vault-secrets' in region us-east-1: AuthorizationHeaderMalformed: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-1' status code: 400

Using ListObjects not only tells you that it can't access the bucket but it tells you what region it is expecting.

…be a bigger request but messages are better than BadRequest, how this changes effect the messages are in the issue
@jefferai
Copy link
Member

Thanks!

@jefferai jefferai merged commit 17b081c into hashicorp:master Jun 20, 2017
chrishoffman pushed a commit that referenced this pull request Jun 21, 2017
* oss/master: (161 commits)
  update gitignore
  changelog++
  Exclude /sys/leases/renew from registering with expiration manager (#2891)
  More cleanup
  Clarify/fix some configuration info.
  Add a convenience function for copying a client (#2887)
  Better error messages using ListObjects than using HeadBucket. Might be a bigger request but messages are better than BadRequest, how this changes effect the messages are in the issue (#2892)
  Add ACL info to Consul configuration page
  Return error on bad CORS and add Header specification to API request primitive
  Add Zyborg.Vault PowerShell module to libs list (#2869)
  changelog++
  CouchDB physical backend (#2880)
  Fix root paths test
  Add missing datadog vendored lib
  changelog++
  Fix up CORS.
  Cors headers (#2021)
  Address review feedback
  Fix the test error message
  Added utility on router to fetch mount entry using its ID
  ...
@jefferai jefferai modified the milestones: 0.7.4, 0.8.0 Jul 24, 2017
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

Successfully merging this pull request may close these issues.

2 participants