1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 01:17:36 +00:00

AK+Userland: Make AK::decode_base64 return ErrorOr

This commit is contained in:
Sam Atkins 2022-01-20 17:18:17 +00:00 committed by Andreas Kling
parent f590cd1850
commit c388a879d7
11 changed files with 31 additions and 43 deletions

View file

@ -162,8 +162,8 @@ void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, con
ByteBuffer data;
if (url.data_payload_is_base64()) {
auto data_maybe = decode_base64(url.data_payload());
if (!data_maybe.has_value()) {
auto error_message = "Base64 data contains an invalid character"sv;
if (data_maybe.is_error()) {
auto error_message = data_maybe.error().string_literal();
log_failure(request, error_message);
error_callback(error_message, {});
return;