checkError static method

void checkError(
  1. int code,
  2. String message
)

Throws an RtlSdrException, if the given code is negative.

Implementation

static void checkError(int code, String message) {
  if (code < 0) {
    for (final errorCode in ErrorCode.values) {
      if (errorCode.code == code) {
        throw RtlSdrException(message, errorCode);
      }
    }
    throw RtlSdrException(message);
  }
}