sse_encode_my_error method

  1. @protected
void sse_encode_my_error(
  1. MyError self,
  2. SseSerializer serializer
)
override

Implementation

@protected
void sse_encode_my_error(MyError self, SseSerializer serializer) {
  // Codec=Sse (Serialization based), see doc to use other codecs
  switch (self) {
    case MyError_Aria2(source: final source):
      sse_encode_i_32(0, serializer);
      sse_encode_String(source, serializer);
    case MyError_Parse(value: final value, to: final to):
      sse_encode_i_32(1, serializer);
      sse_encode_String(value, serializer);
      sse_encode_String(to, serializer);
    case MyError_WebsocketIo(source: final source):
      sse_encode_i_32(2, serializer);
      sse_encode_String(source, serializer);
    case MyError_Json(source: final source):
      sse_encode_i_32(3, serializer);
      sse_encode_String(source, serializer);
    case MyError_WebsocketClosed(message: final message):
      sse_encode_i_32(4, serializer);
      sse_encode_String(message, serializer);
    case MyError_ReconnectTaskTimeout(source: final source):
      sse_encode_i_32(5, serializer);
      sse_encode_String(source, serializer);
  }
}