Skip to content

C++ custom result type used for serialization results#3005

Merged
Wumpf merged 9 commits intomainfrom
andreas/cpp/custom-result-type
Aug 17, 2023
Merged

C++ custom result type used for serialization results#3005
Wumpf merged 9 commits intomainfrom
andreas/cpp/custom-result-type

Conversation

@Wumpf
Copy link
Copy Markdown
Member

@Wumpf Wumpf commented Aug 16, 2023

What

Introduces a very simple rerun::Result. I decided to keep it a lot more simple than the arrow Result type and refrained from the typical "return or assign" etc. macro since I noticed that they get quite complicated quickly.

The idea is that the rerun result type won't be needed by a lot of manual code, so erring on the too lightweight side should be in our favor.

We use this now accross the entire public serialization path - meaning that once we move out array->arrow serialization helper into separate headers we should be pretty much done with not exposing arrow headers!

Checklist

@Wumpf Wumpf added the sdk-cpp C/C++ API specific label Aug 16, 2023
Copy link
Copy Markdown
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Nice!

code = StatusCode::ArrowStatusCode_AlreadyExists;
break;
default:
code = StatusCode::Unknown;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
code = StatusCode::Unknown;
code = StatusCode:: ArrowStatusCode_Unknown;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd argue that's different - we don't know if it's an error unknown, instead it is an error that we literally don't know about

@Wumpf Wumpf force-pushed the andreas/cpp/errorhandling branch from e0a839c to 370bb25 Compare August 17, 2023 11:06
Base automatically changed from andreas/cpp/errorhandling to main August 17, 2023 11:26
@Wumpf Wumpf force-pushed the andreas/cpp/custom-result-type branch from 8872e2d to 036d6d1 Compare August 17, 2023 12:03
@Wumpf Wumpf merged commit 1a37133 into main Aug 17, 2023
@Wumpf Wumpf deleted the andreas/cpp/custom-result-type branch August 17, 2023 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-cpp C/C++ API specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C/C++] Introduce unified error handling

2 participants