lslError function
Builds an LSLException for a nonzero liblsl error code, naming the code and appending liblsl's own message for it when one is available.
Must be called on the thread that made the failing call: liblsl keeps the message in a thread-local buffer, so calling this from a different isolate than the one that failed yields the code alone.
Implementation
LSLException lslError(String what, int code) {
final detailPtr = lsl_last_error();
return lslErrorWithDetail(
what,
code,
detailPtr.isNullPointer ? '' : detailPtr.cast<Utf8>().toDartString(),
);
}