-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fill the
errors
attribute for HTTP errors (#1528)
Some GCS client libraries (like [this one][1]), are quite strict when it comes to the set of attributes they expect to find in the error response. If any of those attributes is missing, they fail to deserialize the error. In `fake-gcs-server`, the `httpError.Errors` attribute was always initialized to `nil`, causing the `error.errors` JSON response attribute to be omitted and leading to failures in some client libraries. In this commit we address that issue by always providing content on the `errors` attribute (`httpError.Errors` field) whenever we return an error response. The implementation is kept simple without aiming to return exactly the same values that are [officially documented][2]. The main goal is to have a sensible response that is _structurally_ correct for the purposes of deserialization client-side. [1]: https://crates.io/crates/google-cloud-storage [2]: https://cloud.google.com/storage/docs/json_api/v1/status-codes
- Loading branch information
1 parent
447880e
commit 7c79b19
Showing
3 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters