Skip to content

refactor(clp-s): Refactor RangeIndexWriter to use ystdlib::error_handling::Result. #1025

@gibber9809

Description

@gibber9809

Request

The implementation to forward range-index metadata in the RangeIndexWriter write method from #1005 is a bit awkward -- it returns a clp_s::ErrorCode as its return value and also returns the metadata as an nlohmann::json object by reference.

It would be better to simply wrap the metadata object in ystdlib::error_handling::Result to return the error code and metadata object at the same time.

While making this change we should also change the other ErrorCode returns from this class to ystdlib::error_handling::Restult<void> in order to provide a consistent interface.

Possible implementation

The easiest implementation is probably to create an ErrorCode enum specific to this class that we can use with ystdlib::error_handling::Result. E.g. IrErrorCode.{cpp,hpp} is a good example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions