encode static method

Implementation

static CborTagValue encode(BuError e) {
  final items = <CborObject?>[e.message.toCbor(), e.details?.toCbor()];
  if (e case RPCError()) {
    return e.toCbor();
  }
  return CborTagValue(CborTagSerializable.listFromDynamic(items), [
    e.type.id,
  ]);
}