dco_decode_my_error method

  1. @protected
MyError dco_decode_my_error(
  1. dynamic raw
)
override

Implementation

@protected
MyError dco_decode_my_error(dynamic raw) {
  // Codec=Dco (DartCObject based), see doc to use other codecs
  switch (raw[0]) {
    case 0:
      return MyError_Aria2(
        source: dco_decode_String(raw[1]),
      );
    case 1:
      return MyError_Parse(
        value: dco_decode_String(raw[1]),
        to: dco_decode_String(raw[2]),
      );
    case 2:
      return MyError_WebsocketIo(
        source: dco_decode_String(raw[1]),
      );
    case 3:
      return MyError_Json(
        source: dco_decode_String(raw[1]),
      );
    case 4:
      return MyError_WebsocketClosed(
        message: dco_decode_String(raw[1]),
      );
    case 5:
      return MyError_ReconnectTaskTimeout(
        source: dco_decode_String(raw[1]),
      );
    default:
      throw Exception("unreachable");
  }
}