package com.miya.print.utils;

import com.miya.print.PrinterStatusEnum;

/**
 * 检查操作结果工具类
 */
public class CheckStatusUtils {

    public static void checkState(int ret) {
        if (ret != 0) {
            for (PrinterStatusEnum statusEnum : PrinterStatusEnum.values()) {
                if (ret == statusEnum.getStatus()) {
                    throw new RuntimeException(statusEnum.getStatus() + ":" + statusEnum.getDesc());
                }
            }
        }
    }
}
