getFailure method

String getFailure()

Reads the message of the error that made the session fail.

RenderSessionSnapshot.failureStatus reports the error's status. The message is empty while the session hasn't failed, and doesn't change once it fails.

See mln_render_session_get_failure in the C API reference.

Implementation

String getFailure() => withNativeArena((arena) {
  final text = _CallerSizedText();
  _check(
    text.call(
      arena,
      (textStorage, textCapacity, textLength) =>
          raw.mln_render_session_get_failure(
            _handle.raw,
            textStorage,
            textCapacity,
            textLength,
            nativeDiagnostic,
          ),
    ),
  );
  return utf8.decode(text.text);
});