1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved // // SPDX-License-Identifier: MIT OR Apache-2.0 use thiserror::Error; use crate::base58btc::Base58Error; /// Error returned when decoding a multibase string fails. #[derive(Debug, Error)] #[non_exhaustive] pub enum MultibaseError { /// The input is too short to contain a multibase prefix and payload. #[error("invalid multibase string: too short")] TooShort, // Deliberately carries no payload: the rejected prefix comes from // untrusted input, and error variants must not echo it back. /// The leading multibase prefix denotes an unsupported base encoding. #[error("unsupported multibase prefix")] UnsupportedPrefix, /// The base58btc payload failed to decode. #[error(transparent)] Base58(#[from] Base58Error), /// The base64url payload failed to decode. #[error("invalid base64url")] Base64Url, /// The encoded output length would exceed the supported allocation domain. #[error("multibase encoded length overflow")] LengthOverflow, }