zaber.motion.exceptions.BinaryCommandFailedException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of motion-library Show documentation
Show all versions of motion-library Show documentation
A library that aims to provide easy-to-use API for communication with Zaber devices using Zaber ASCII Protocol.
// ===== THIS FILE IS GENERATED FROM A TEMPLATE ===== //
// ============== DO NOT EDIT DIRECTLY ============== //
package zaber.motion.exceptions;
import zaber.motion.protobufs.Main;
import com.google.protobuf.InvalidProtocolBufferException;
/**
* Thrown when a device rejects a binary command with an error.
*/
public class BinaryCommandFailedException extends MotionLibException {
private BinaryCommandFailedExceptionData details;
/**
* @return Additional data for BinaryCommandFailedException
*/
public BinaryCommandFailedExceptionData getDetails() {
return this.details;
}
public BinaryCommandFailedException(String message, byte[] customData) {
super(message);
try {
Main.BinaryCommandFailedExceptionData protobufObj = Main.BinaryCommandFailedExceptionData.parser().parseFrom(customData);
this.details = BinaryCommandFailedExceptionData.fromProtobuf(protobufObj);
} catch (InvalidProtocolBufferException e) {
throw new LibraryIntegrationException("Could not parse custom data for BinaryCommandFailedException", e);
}
}
public BinaryCommandFailedException(String message, BinaryCommandFailedExceptionData customData) {
super(message);
this.details = customData;
}
}