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

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

Merged
merged 9 commits into from
Aug 17, 2023

Conversation

Wumpf
Copy link
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 🌊 C++ API C/C++ API specific label Aug 16, 2023
Copy link
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!

crates/re_types_builder/src/codegen/cpp/mod.rs Outdated Show resolved Hide resolved
rerun_cpp/src/rerun/arrow.cpp Outdated Show resolved Hide resolved
rerun_cpp/src/rerun/recording_stream.hpp Outdated Show resolved Hide resolved
rerun_cpp/src/rerun/recording_stream.hpp Outdated Show resolved Hide resolved
rerun_cpp/src/rerun/result.hpp Outdated Show resolved Hide resolved
code = StatusCode::ArrowStatusCode_AlreadyExists;
break;
default:
code = StatusCode::Unknown;
Copy link
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
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

rerun_cpp/src/rerun/status.hpp Outdated Show resolved Hide resolved
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
23 checks passed
@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
🌊 C++ API 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