package com.simplenote.android.net;

/**
 * Class to represent what should happen for different HTTP status codes
 * @author bryanjswift
 *
 */
public abstract class HttpCallback {
	/** Create a static empty callback object */
	public static final HttpCallback EMPTY;
	static {
		EMPTY = new HttpCallback() { };
	}
	/**
	 * Called when the response contained a success status code
	 * @param body contents of the response
	 */
	public void on200(String body) { }
	/**
	 * Bad Request
	 * @param body contents of the response
	 */
	public void on400(String body) { }
	/**
	 * Unauthorized
	 * @param body contents of the response
	 */
	public void on401(String body) { }
	/**
	 * Forbidden
	 * @param body contents of the response
	 */
	public void on403(String body) { }
	/**
	 * Not Found
	 * @param body contents of the response
	 */
	public void on404(String body) { }
	/**
	 * Server error
	 * @param body contents of the response
	 */
	public void on500(String body) { }
	/**
	 * Called when the request is finished no matter what the response was
	 * @param body contents of the response
	 */
	public void onComplete(String body) { }
	/**
	 * Called when an exception is thrown, this isn't really an HTTP case
	 * @param url requested that caused the exception
	 * @param data sent with the request
	 * @param t - the exception thrown
	 */
	public void onException(String url, String data, Throwable t) { }
}

@@ -30,16 +30,62 @@
 d.net;%0A%0A
+import java.util.List;%0Aimport java.util.Map;%0A%0A
 /**%0A * C
@@ -180,11 +180,8 @@
 ift%0A
- *%0A
  */%0A
@@ -1173,32 +1173,346 @@
  body) %7B %7D%0A%09/**%0A
+%09 * Called when the request is finished and the status code was anything indicating an error%0A%09 * @param status code causing the error%0A%09 * @param body contents of the response%0A%09 * @param headers included in the response%0A%09 */%0A%09public void onError(int status, String body, Map%3CString, List%3CString%3E%3E headers) %7B %7D%0A%09/**%0A
 %09 * Called when 

Add onError method to call when a non-success status is received