Skip to content

Add more variants to ErrorKind #1038

Open
@connortsui20

Description

@connortsui20

Is your feature request related to a problem or challenge?

As of now, ErrorKind looks like this (doc comments removed):

pub enum ErrorKind {
    Unexpected,
    DataInvalid,
    FeatureUnsupported,
}

This is pretty bare, especially since there are whole classes of things that can go wrong with respect to the Iceberg Catalog trait. See #965 and this comment for some context for this specific repo, as well as the official REST API specification.

It would be nice if there was a dedicated error type for Catalog errors. Some simple things that could be added are variants for tables or namespaces that don't exist, or duplicate tables or namespaces. There are many other things that can go wrong. Right now #965 just uses string messages to represent those errors, which is not ideal.

Adding dedicated error types would also mean the different implementations of the Iceberg Catalog could be more easily unified: the exact return behavior of each method would be the same among every implementation (instead of having a different error message depending on which implementation you choose).

Describe the solution you'd like

I think there are many ways to do this, some better than others. I would say that the current method manually implementing error messages, backtrace, and variants is somewhat shaky. Personally, I think that adding thiserror or snafu as a dependency for this would ease development going forward, not just the error types specified above (for the catalog) but for any other error kinds that Iceberg needs / may introduce.

Willingness to contribute

  • I can contribute to this feature independently
  • I would be willing to contribute to this feature with guidance from the Iceberg Rust community
  • I cannot contribute to this feature at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions