throwIfFailed function

void throwIfFailed(
  1. Pointer<CvStatus> s
)

Implementation

void throwIfFailed(ffi.Pointer<cvg.CvStatus> s) {
  final code = s.ref.code;
  // String err = s.ref.err.cast<Utf8>().toDartString();
  final msg = s.ref.msg.cast<Utf8>().toDartString();
  final file = s.ref.file.cast<Utf8>().toDartString();
  final funcName = s.ref.func.cast<Utf8>().toDartString();
  final line = s.ref.line;
  ccore.CvStatus_close(s);
  if (code != 0) {
    throw CvException(code, msg: msg, file: file, func: funcName, line: line);
  }
}