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

Add error codes for file read/write/open failures #1061

Merged
merged 1 commit into from
Sep 26, 2023
Merged

Add error codes for file read/write/open failures #1061

merged 1 commit into from
Sep 26, 2023

Conversation

graebm
Copy link
Contributor

@graebm graebm commented Sep 26, 2023

I wanted to raise something more specific than AWS_ERROR_SYS_CALL_FAILURE when an S3 operation failed due to an failed fwrite() to disk. Then it seemed weird to add a WRITE_FAILURE code, but no READ_FAILURE or OPEN_FAILURE codes.

Description of changes:

  • New error codes: AWS_ERROR_FILE_(OPEN/READ/WRITE)_FAILURE
  • Add new variant of aws_translate_and_raise_io_error() that lets you suggest a fallback error-code if no good match is found

Debatable Issues:
aws-c-io already has AWS_IO_STREAM_READ_FAILED. This makes it weird to add AWS_ERROR_FILE_READ_FAILURE to aws-c-common. In a perfect world, we'd move the error from aws-c-io to aws-c-common and possibly rename it, but either of those actions would be a breaking change.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@graebm graebm merged commit 4c0a9f5 into main Sep 26, 2023
51 checks passed
@graebm graebm deleted the file-errors branch September 26, 2023 23:05
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