38 lines
651 B
D
38 lines
651 B
D
module msgpackrpc.protocol;
|
|
|
|
version(WithRPC) {
|
|
import std.exception;
|
|
|
|
import msgpack;
|
|
|
|
enum MessageType {
|
|
request = 0,
|
|
response = 1,
|
|
notify = 2
|
|
}
|
|
|
|
/**
|
|
* Thrown when the wire protocol could not be parsed.
|
|
*/
|
|
class ProtocolException : Exception {
|
|
mixin basicExceptionCtors;
|
|
}
|
|
|
|
/**
|
|
* Thrown when the other endpoint reports an error.
|
|
*/
|
|
class RPCException : Exception {
|
|
private:
|
|
Value m_value;
|
|
public:
|
|
this(Value value, string file = __FILE__, int line = __LINE__, Throwable next = null) {
|
|
super(value.as!string, file, line, next);
|
|
this.m_value = value;
|
|
}
|
|
|
|
@property Value value() { return m_value; }
|
|
|
|
}
|
|
|
|
} // version(WithRPC)
|