History log of /openbmc/sdbusplus/src/exception.cpp (Results 1 – 18 of 18)
Revision Date Author Comments
# b08d14dd 05-Nov-2024 Patrick Williams <patrick@stwcx.xyz>

sdbus++: events: unpack an event from JSON

Generate code necessary to unpack a generated event from its
JSON representation.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I7a28617f

sdbus++: events: unpack an event from JSON

Generate code necessary to unpack a generated event from its
JSON representation.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I7a28617f3f0374968609328a44587b655a9141c1

show more ...


# a4bfefde 24-Sep-2024 Patrick Williams <patrick@stwcx.xyz>

exception: move sd_bus_error_set calls to exception

In the future, generated exceptions will need to fill the sd_error
with something other than the "description" in order to pass more
metadata. Mo

exception: move sd_bus_error_set calls to exception

In the future, generated exceptions will need to fill the sd_error
with something other than the "description" in order to pass more
metadata. Move the sd_bus_error_set calls to exception as a virtual
function so this can be accomplished.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6e6947e4977701a8e7e27fef119bd35e837d866b

show more ...


# 06f265f6 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I4f63258febea27dae710c252033b9151e02be7e8
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 70bcf14c 26-Jul-2023 Patrick Williams <patrick@stwcx.xyz>

exception: add string r-value constructor

If we are building a string as part of throwing this exception type,
it is more efficient to move the string rather than getting the
`c_str()` and doing ano

exception: add string r-value constructor

If we are building a string as part of throwing this exception type,
it is more efficient to move the string rather than getting the
`c_str()` and doing another allocation inside the class.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibec1c550f82208d5dde6dfef1626f907b7d2ad50

show more ...


# ed4a5a64 05-Jan-2023 Ed Tanous <edtanous@google.com>

Fix variable shadow warnings in sdbusplus

-Wshadow is useful for subprojects to enable, because it can find bugs
in common variable names (err, r, i, etc). With these changes, projects
can now buil

Fix variable shadow warnings in sdbusplus

-Wshadow is useful for subprojects to enable, because it can find bugs
in common variable names (err, r, i, etc). With these changes, projects
can now build sdbusplus with -Wshadow enabled.

The changes fall into a couple buckets. The first is for constructor
variables that match the member variable name. In these cases, "_in" is
appended to the end of the constructor variable name.

The second is a case where the variable "r" was used for return codes
twice. One instance is changed to "ret".

With these changes, projects can compile with -Wshadow enabled without
warnings.

Change-Id: Ia33a6f8306473c616f6278bb848460167e5463ef
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# c3484735 04-Jan-2023 Ed Tanous <edtanous@google.com>

Add static to method

This function isn't used outside of this compile unit, and has no
definition in a header. Declare it static.

Change-Id: Ibebbaec1926cf03380fb5dff063eccef061ad809
Signed-off-by

Add static to method

This function isn't used outside of this compile unit, and has no
definition in a header. Declare it static.

Change-Id: Ibebbaec1926cf03380fb5dff063eccef061ad809
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# 4cfc284d 22-Sep-2022 Patrick Williams <patrick@stwcx.xyz>

async: handle exceptions and stops

Add support in `context` and `scope` to handle exceptions and stop
conditions:

* When an unhandled_stop occurs, turn it into an UnhandledStop
exception.
*

async: handle exceptions and stops

Add support in `context` and `scope` to handle exceptions and stop
conditions:

* When an unhandled_stop occurs, turn it into an UnhandledStop
exception.
* When a `scope`-spawned task throws an exception, save it and cause
`set_error` on the `scope::empty()`'s Receiver.
* When anything in the `context` completes with `set_error` propagate
that out to the caller of `context::run`.
* If multiple exceptions occur within a `scope`, terminate.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I25285f7ece5c0675864489bbe1345fa8e7afa70c

show more ...


# f289c65f 26-Aug-2022 Patrick Williams <patrick@stwcx.xyz>

clang-format: update with latest

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I461b17ee197528f125239f3cb8678dca45eaa634


# c8447d52 05-Jan-2022 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

added support for optionals in unpackProperties

- Added support for optionals
- Added support for pointers
- Removed support for moving data from input container
- Removed support for container type

added support for optionals in unpackProperties

- Added support for optionals
- Added support for pointers
- Removed support for moving data from input container
- Removed support for container types other than std::vector

Tested:
- Unit tests are passing
- Examples which use unpackProperties are working correctly

Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I3dbd7333237a1373d784187951ad6abe217567d1

show more ...


# 6d83cf53 19-Oct-2021 Szymon Dompke <szymon.dompke@intel.com>

Add non-throwing version of unpackProperties

Some projects (e.g., bmcweb) don't use functions which throw exceptions.
This change introduces unpackPropertiesNoThrow() function, which returns
optiona

Add non-throwing version of unpackProperties

Some projects (e.g., bmcweb) don't use functions which throw exceptions.
This change introduces unpackPropertiesNoThrow() function, which returns
optional string. In case of mismatched type or missing property, it will
contain its name. In case of no errors, std::nullopt will be returned.

As a side change, message returned by UnpackPropertyError::what() now
also includes propertyName and reason.

Testing done:
- Added unit tests for unpackPropertiesNoThrow().
- unpackProperties() functionality remained the same.

Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: I61318bb906de7d5a252414c1d3ea25322874e23e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# a8e3502c 28-Sep-2021 Patrick Williams <patrick@stwcx.xyz>

exception: ensure base exception vtable is non-hidden

I found that when building this library under Yocto, `-flto=auto` is
used by default and the vtable for the exception class ends up becoming
hid

exception: ensure base exception vtable is non-hidden

I found that when building this library under Yocto, `-flto=auto` is
used by default and the vtable for the exception class ends up becoming
hidden (since there are no non-pure/non-inline functions). I've tried
using `__attribute__((visibility("default")))` with no luck. The only
thing which seems to work is defining some non-inline function to force
the vtable to be emitted.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iaac957591be38d38d021503e15e16f0c982808a9

show more ...


# b68700e8 09-Sep-2021 Patrick Williams <patrick@stwcx.xyz>

exception: make base get_errno pure virtual

In order to enforce that exception authors make an explicit decision
on the errno, switch get_errno to pure virtual.

Signed-off-by: Patrick Williams <pat

exception: make base get_errno pure virtual

In order to enforce that exception authors make an explicit decision
on the errno, switch get_errno to pure virtual.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I647ef6802149b1092b115fdc78bb9f3e5e67bfa0

show more ...


# 15228663 03-Sep-2021 Patrick Williams <patrick@stwcx.xyz>

exception: create subclass for generated errors

All errors generated by sdbus++ YAML we want to follow the systemd
default errno value (EIO). All exceptions defined otherwise it is
probably a good

exception: create subclass for generated errors

All errors generated by sdbus++ YAML we want to follow the systemd
default errno value (EIO). All exceptions defined otherwise it is
probably a good idea to ensure that the author picks an explicit
errno.

Create a base class for generated exceptions to hold the default
`get_errno() { return EIO; }` implementation, which can be used by
various repositories and later turn the exception_t one into a pure
virtual.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I2648825b677353970eed4724bd2d3710a103d814

show more ...


# bd372ecb 02-Sep-2021 Patrick Williams <patrick@stwcx.xyz>

exception: add errno for internal errors

Assign errnos for InvalidEnumString and UnpackPropertyError.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I1ca283050a95846f9409554696880fc

exception: add errno for internal errors

Assign errnos for InvalidEnumString and UnpackPropertyError.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I1ca283050a95846f9409554696880fc043570edf

show more ...


# b6f729d6 02-Sep-2021 Patrick Williams <patrick@stwcx.xyz>

exception: add errno for all exceptions

sd_bus maintains an errno for all exceptions. There are some
users of the library that are catching an SdBusError because they
want an easy way to change to

exception: add errno for all exceptions

sd_bus maintains an errno for all exceptions. There are some
users of the library that are catching an SdBusError because they
want an easy way to change to an errno, but as a result they are
potentially missing exceptions. Add the `get_errno` method into
our base exception object and return the same default that sd_bus
uses: EIO.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5d7610f78934c94841f99573db6adca2b5ec895c

show more ...


# 0c8136a4 28-Aug-2021 Patrick Williams <patrick@stwcx.xyz>

enable building with clang

Clang is more pedantic about systemd's use of C99 extensions when
high warning levels are enabled. Disable the "-Wc99-extensions"
when using the SD_BUS_ERROR_NULL macro f

enable building with clang

Clang is more pedantic about systemd's use of C99 extensions when
high warning levels are enabled. Disable the "-Wc99-extensions"
when using the SD_BUS_ERROR_NULL macro from systemd. This enables
sdbusplus to compile with clang.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5433244ad33e5803d0291de11056a7feee57d55c

show more ...


# 09b88f26 02-Sep-2020 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

Added utility functions getAllProperties and unpackProperties

Tested:
- Added example to verify that functions work correctly
- Added new unit tests that are passing
- All other tests are stil

Added utility functions getAllProperties and unpackProperties

Tested:
- Added example to verify that functions work correctly
- Added new unit tests that are passing
- All other tests are still passing after this change
- Added handling of new type (std::monostate) which can
be used as first type in variant to represent that none
of the other types was matched

Change-Id: Ic8e7c8d3116d64b94be37147ae8a80ebb5d3811d
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>

show more ...


# 7f664254 04-Jun-2020 Patrick Williams <patrick@stwcx.xyz>

build: split source and header directories

Split the headers and source to simplify the install_header
directive such that we no longer need to specify cpp files
to exclude in the install_header cal

build: split source and header directories

Split the headers and source to simplify the install_header
directive such that we no longer need to specify cpp files
to exclude in the install_header call.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iac4c38f95e690aa8ef8ecf87b032f55a1a31409c

show more ...