Skip to content

common: tools: error: construct error from both enum and errno - #648

Open
mlohvynenko wants to merge 1 commit into
aosedge:developfrom
mlohvynenko:feature_add_err_const
Open

common: tools: error: construct error from both enum and errno#648
mlohvynenko wants to merge 1 commit into
aosedge:developfrom
mlohvynenko:feature_add_err_const

Conversation

@mlohvynenko

Copy link
Copy Markdown
Member

This patch adds a constructor to the Error class that allows constructing an Error object from both an ErrorEnum and an errno value.
It is useful when an error is constructed from a gRPC response, for example, when the gRPC response contains both an AOS error code and an exit code (errno).
Otherwise, there is no way to propagate both error codes to the Error object, and one of them would be lost.

@mlohvynenko
mlohvynenko force-pushed the feature_add_err_const branch from 230f66c to af1f7f3 Compare August 20, 2026 14:11
Comment thread src/core/common/tools/error.hpp

@al1img al1img left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>

This patch adds a constructor to the Error class that allows
constructing an Error object from both an ErrorEnum and an
errno value.
It is useful when an error is constructed from a gRPC response,
for example, when the gRPC response contains both an AOS error code
and an exit code (errno).
Otherwise, there is no way to propagate both error codes
to the Error object, and one of them would be lost.

Signed-off-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
@mlohvynenko
mlohvynenko force-pushed the feature_add_err_const branch from af1f7f3 to cfc0b1a Compare August 26, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants