pvStatusToException function
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);
case PvStatus.STOP_ITERATION:
throw new PvStatusStopIterationError(errorMessage);
case PvStatus.KEY_ERROR:
throw new PvStatusKeyError(errorMessage);
case PvStatus.INVALID_STATE:
throw new PvStatusInvalidStateError(errorMessage);
default:
print("Unmapped error code: $pvStatus");
throw new PvError(errorMessage);
}
}