All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.digitalpetri.modbus.ModbusTimeoutException Maven / Gradle / Ivy

There is a newer version: 1.2.2
Show newest version
package com.digitalpetri.modbus;

import java.time.Duration;

public class ModbusTimeoutException extends Exception {

    private final long durationMillis;

    public ModbusTimeoutException(Duration duration) {
        this(duration.toMillis());
    }

    public ModbusTimeoutException(long durationMillis) {
        this.durationMillis = durationMillis;
    }

    @Override
    public String getMessage() {
        return String.format("request timed out after %sms milliseconds.", durationMillis);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy