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.
Request
The implementation to forward range-index metadata in the
RangeIndexWriterwritemethod from #1005 is a bit awkward -- it returns aclp_s::ErrorCodeas its return value and also returns the metadata as annlohmann::jsonobject by reference.It would be better to simply wrap the metadata object in
ystdlib::error_handling::Resultto return the error code and metadata object at the same time.While making this change we should also change the other
ErrorCodereturns from this class toystdlib::error_handling::Restult<void>in order to provide a consistent interface.Possible implementation
The easiest implementation is probably to create an
ErrorCodeenum specific to this class that we can use withystdlib::error_handling::Result. E.g.IrErrorCode.{cpp,hpp}is a good example.