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

Introduce a new error type for ObjectStorage api #45

Merged
merged 4 commits into from
Aug 18, 2022

Conversation

trueleo
Copy link
Contributor

@trueleo trueleo commented Aug 18, 2022

Fixes #42.

Description

Create a separate error type for all the methods defined by ObjectStorage. This ObjectStorageError should contain those failure variants over which we want to handle error in future.

AwsSdkError and SdkError in AWS S3 crate covers all the variants for failure when calling S3 APIs but parseable needs to have its own Error type that can be used for error handling in the application itself.

Added ObjectStorageError type which contains some variants through which we can tell what went wrong when using any of trait methods on S3 object. Though the error variants need to expand in future so that more complex cases could be handled correctly


This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviours.

server/src/option.rs Outdated Show resolved Hide resolved
server/src/option.rs Show resolved Hide resolved
_ => continue,
let metadata = LogStreamMetadata {
schema: schema.unwrap_or_default(),
alert_config: alert_config.unwrap_or_default(),
Copy link
Contributor Author

@trueleo trueleo Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of returning or not adding metadata to stream we set it to empty string for now. This allows first event to not fail in case parseable was restarted just after adding a stream.

This behaviour could be changed later by using Option type in LogStreamMetadata.

@trueleo trueleo marked this pull request as ready for review August 18, 2022 08:46
@nitisht nitisht merged commit 73ce04b into parseablehq:main Aug 18, 2022
@trueleo trueleo deleted the storage_err branch August 18, 2022 16:08
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.

Panic when bucket doesn't exists
2 participants