statusFrame static method

Uint8List statusFrame(
  1. int frameType,
  2. int streamId,
  3. StatusException status
)

Implementation

static Uint8List statusFrame(
    int frameType, int streamId, StatusException status) {
  final body = jsonEncode({
    'code': status.code,
    'message': status.message,
    if (status.trailers.isNotEmpty) 'metadata': status.trailers,
  });
  return encodeFrame(frameType, streamId, utf8.encode(body));
}