BuError class

Sole exception type for the blockchain_utils connector.

Public APIs must only throw or return BuError / BuResult.err. A BuError is just a code, a message and string-only details.

Implemented types
Implementers
Available extensions

Constructors

BuError(BuErrorType type, String message, {Map<String, String?>? details})
const

Properties

details → Map<String, String?>?
Extra fields for debugging. Values are strings only.
final
hashCode → int
The hash code for this object.
no setterinherited
message → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → BuErrorType
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toCbor() → CborTagValue<CborObject<Object?>>

Available on BuError, provided by the BuErrorEncoding extension

toCborBytes() → List<int>

Available on BuError, provided by the BuErrorEncoding extension

toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

argument(String message, {Map<String, String?>? details}) → BuError
auth() → BuError
fromNativeCode(int rc, {Map<String, String?>? details}) → BuError
Generic native return-code numbering (Rust FFI): 1 null, 2 key, 3 nonce, 4 length, 5 auth, 6 unsupported, 7 internal, 8 state, 9 buffer size, 10 argument, 11 not initialized, 12 point, 13 scalar, 14 verify, 15 zero scalar, 16 signature. Modules with their own numbering translate to these ints first. Never forwards opaque Rust strings.
internalErr({String message = 'internal cryptographic error'}) → BuError
key({String message = 'invalid key material', Map<String, String?>? details}) → BuError
length({required String what, required int expected, required int actual}) → BuError
lengthOneOf({required String what, required List<int> allowed, required int actual}) → BuError
nonce({String message = 'invalid nonce or IV', Map<String, String?>? details}) → BuError
notInit() → BuError
point({String message = 'point is not on the curve or is malformed'}) → BuError
scalar({String message = 'invalid scalar', bool zero = false}) → BuError
state({String message = 'object is cleaned or cannot be used again'}) → BuError
unsupportedAlgo({String message = 'unsupported algorithm or configuration'}) → BuError
verify() → BuError

Constants

authFailed → const BuError
bufferTooSmall → const BuError
internal → const BuError
invalidArgument → const BuError
invalidKey → const BuError
invalidLength → const BuError
invalidNonce → const BuError
invalidPoint → const BuError
invalidScalar → const BuError
invalidState → const BuError
notInitialized → const BuError
unsupported → const BuError