-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ObjectClient error types (part 1/2)
Our current ObjectClient allows each implementer to provide its own error types for each request. This is nice and flexible, but prevents callers of an ObjectClient from being generic if they want to detect common service errors like NoSuchKey -- they must know the concrete error type of the particular client they're using to match on these errors. We've been getting away with this until #69, where we need to be able to distinguish (expected) 404 errors from other errors on HeadObject. This change refactors ObjectClient to provide a common service error type for each operation. ObjectClients now return an error that is *either* a modeled service error like NoSuchKey *or* a client-specific error. This allows callers to be generic over the ObjectClient and still discriminate on the interesting error types, where by "interesting" I mean things I think it's likely a caller might want to know about. The diff was getting pretty big so I'm splitting this into two commits. This is Part 1, which just does the refactoring, but doesn't change our S3CrtClient to return the new modeled service errors. That means this change shouldn't cause any functional change -- every error will be a client error, like it was before this commit. I'll follow up with Part 2 that adds the service errors to S3CrtClient (so does XML parsing etc). Signed-off-by: James Bornholt <[email protected]>
- Loading branch information
1 parent
3436138
commit 7c6e34d
Showing
14 changed files
with
386 additions
and
273 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.