pvStatusToException function

dynamic pvStatusToException(
  1. PvStatus pvStatus,
  2. String errorMessage
)

Implementation

pvStatusToException(PvStatus pvStatus, String errorMessage) {
  switch (pvStatus) {
    case PvStatus.OUT_OF_MEMORY:
      throw new PvStatusOutOfMemoryError(errorMessage);
    case PvStatus.IO_ERROR:
      throw new PvStatusIoError(errorMessage);
    case PvStatus.INVALID_ARGUMENT:
      throw new PvStatusInvalidArgumentError(errorMessage);
    default:
      print("Unmapped error code: $pvStatus");
      throw new PvError(errorMessage);
  }
}