docstr: Check a `const char*` error return from an integration entrypoint.
  
  A null means success, a non-empty string is an error message.
  The string is dynamically allocated on the Rust side.
docstr_tok: ["Check","a","`","const","char","*","`","error","return","from","an","integration","entrypoint",".","A","null","means","success",",","a","non-empty","string","is","an","error","message",".","The","string","is","dynamically","allocated","on","the","Rust","side","."]
code: def _check_rust_error(self, rs_error):
      """
      Check a `const char*` error return from an integration entrypoint.
  
      A null means success, a non-empty string is an error message.
      The string is dynamically allocated on the Rust side.
      """
      assert self.ffi.typeof(rs_error) is self.ffi.typeof("const char*")
      if rs_error != self.ffi.NULL:
          try:
              error = self.ffi.string(rs_error).decode(
                  "utf8", errors="replace"
              )
              raise RuntimeError(
                  f"Rust C Data Integration call failed: {error}"
              )
          finally:
              self.dll.arrow_rs_free_error(rs_error)
  
imports: import contextlib
  import functools
  import os
  import subprocess
  from .None import cdata
  from .tester import Tester, CDataExporter, CDataImporter
  from .util import run_cmd, log
  from ..utils.source import ARROW_ROOT_DEFAULT
label_desc: Use image node_id 3 for calling the _CDataBase obj's underlying member method code with example usage: obj._check_rust_error(rs_error) without return types