1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:27:35 +00:00

Everywhere: Split Error::from_string_literal and Error::from_string_view

Error::from_string_literal now takes direct char const*s, while
Error::from_string_view does what Error::from_string_literal used to do:
taking StringViews. This change will remove the need to insert `sv`
after error strings when returning string literal errors once
StringView(char const*) is removed.

No functional changes.
This commit is contained in:
sin-ack 2022-07-11 17:57:32 +00:00 committed by Andreas Kling
parent c70f45ff44
commit e5f09ea170
51 changed files with 282 additions and 261 deletions

View file

@ -59,7 +59,7 @@ ErrorOr<void> Launcher::add_allowed_url(URL const& url)
{
auto response_or_error = connection().try_add_allowed_url(url);
if (response_or_error.is_error())
return Error::from_string_literal("Launcher::add_allowed_url: Failed"sv);
return Error::from_string_literal("Launcher::add_allowed_url: Failed");
return {};
}
@ -67,7 +67,7 @@ ErrorOr<void> Launcher::add_allowed_handler_with_any_url(String const& handler)
{
auto response_or_error = connection().try_add_allowed_handler_with_any_url(handler);
if (response_or_error.is_error())
return Error::from_string_literal("Launcher::add_allowed_handler_with_any_url: Failed"sv);
return Error::from_string_literal("Launcher::add_allowed_handler_with_any_url: Failed");
return {};
}
@ -75,7 +75,7 @@ ErrorOr<void> Launcher::add_allowed_handler_with_only_specific_urls(String const
{
auto response_or_error = connection().try_add_allowed_handler_with_only_specific_urls(handler, urls);
if (response_or_error.is_error())
return Error::from_string_literal("Launcher::add_allowed_handler_with_only_specific_urls: Failed"sv);
return Error::from_string_literal("Launcher::add_allowed_handler_with_only_specific_urls: Failed");
return {};
}
@ -83,7 +83,7 @@ ErrorOr<void> Launcher::seal_allowlist()
{
auto response_or_error = connection().try_seal_allowlist();
if (response_or_error.is_error())
return Error::from_string_literal("Launcher::seal_allowlist: Failed"sv);
return Error::from_string_literal("Launcher::seal_allowlist: Failed");
return {};
}