mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
Kernel: Make KString factories return KResultOr + use TRY() everywhere
There are a number of places that don't have an error propagation path right now, so I've added FIXME's about that.
This commit is contained in:
parent
69b9b2888c
commit
56a2594de7
21 changed files with 100 additions and 122 deletions
|
@ -864,11 +864,9 @@ KResult Process::set_coredump_property(NonnullOwnPtr<KString> key, NonnullOwnPtr
|
|||
|
||||
KResult Process::try_set_coredump_property(StringView key, StringView value)
|
||||
{
|
||||
auto key_kstring = KString::try_create(key);
|
||||
auto value_kstring = KString::try_create(value);
|
||||
if (key_kstring && value_kstring)
|
||||
return set_coredump_property(key_kstring.release_nonnull(), value_kstring.release_nonnull());
|
||||
return ENOMEM;
|
||||
auto key_kstring = TRY(KString::try_create(key));
|
||||
auto value_kstring = TRY(KString::try_create(value));
|
||||
return set_coredump_property(move(key_kstring), move(value_kstring));
|
||||
};
|
||||
|
||||
static constexpr StringView to_string(Pledge promise)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue