askarGetCurrentError function

AskarResult<String> askarGetCurrentError()

Implementation

AskarResult<String> askarGetCurrentError() {
  Pointer<Pointer<Utf8>> utf8PtPointer = calloc<Pointer<Utf8>>();

  try {
    final errorCode = ErrorCode.fromInt(nativeAskarGetCurrentError(utf8PtPointer));

    final String value =
        (errorCode == ErrorCode.success) ? utf8PtPointer.value.toDartString() : "";

    return AskarResult<String>(errorCode, value);
  } finally {
    freeDoublePointer(utf8PtPointer);
  }
}