package com.ecwid.consul.v1;

import com.ecwid.consul.ConsulException;
import com.ecwid.consul.transport.RawResponse;

/**
 * @author Vasily Vasilkov (vgv@ecwid.com)
 */
public final class OperationException extends ConsulException {

	private final int statusCode;
	private final String statusMessage;

	public OperationException(int statusCode, String statusMessage) {
		this.statusCode = statusCode;
		this.statusMessage = statusMessage;
	}

	public OperationException(RawResponse rawResponse) {
		this(rawResponse.getStatusCode(), rawResponse.getStatusMessage());
	}

	public int getStatusCode() {
		return statusCode;
	}

	public String getStatusMessage() {
		return statusMessage;
	}
}

@@ -682,11 +682,318 @@
 sage;%0A%09%7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        final StringBuffer sb = new StringBuffer(%22OperationException%7B%22);%0A        sb.append(%22statusCode=%22).append(statusCode);%0A        sb.append(%22, statusMessage='%22).append(statusMessage).append('%5C'');%0A        sb.append('%7D');%0A        return sb.toString();%0A    %7D
 %0A%7D%0A

add toString to print status code and message to help diagnose errors