package com.growthbeat.exception;

import com.growthbeat.model.Error;

public class ApiException extends GrowthbeatException {

	private static final long serialVersionUID = 1L;

	private int statusCode;
	private Error error;

	public ApiException(int statusCode) {
		super();
		setStatusCode(statusCode);
	}

	public ApiException(int statusCode, Error error) {
		this(statusCode);
		setError(error);
	}

	public Error getError() {
		return error;
	}

	public void setError(Error error) {
		this.error = error;
	}

	public int getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(int statusCode) {
		this.statusCode = statusCode;
	}

}

@@ -267,16 +267,67 @@
 %09%09super(
+String.format(%22Invalid status code %25d%22, statusCode)
 );%0A%09%09set
@@ -408,20 +408,128 @@
 or) %7B%0A%09%09
-this
+super(error != null ? error.getMessage() : String.format(%22Invalid status code %25d%22, statusCode));%0A%09%09setStatusCode
 (statusC

Add message in ApiException