001 // Copyright 2006 Waterken Inc. under the terms of the MIT X license
002 // found at http://www.opensource.org/licenses/mit-license.html
003 package org.ref_send.promise;
004
005 import org.joe_e.Powerless;
006 import org.ref_send.deserializer;
007 import org.ref_send.name;
008
009 /**
010 * Indicates a failed HTTP request.
011 */
012 public class
013 Failure extends NullPointerException implements Powerless {
014 static private final long serialVersionUID = 1L;
015
016 /**
017 * entity size expected to trigger a <code>413</code> response: {@value}
018 */
019 static public final int maxEntitySize = 256 * 1024;
020
021 /**
022 * HTTP status code
023 */
024 public final String status;
025
026 /**
027 * HTTP reason phrase
028 */
029 public final String phrase;
030
031 /**
032 * Constructs an instance.
033 * @param status {@link #status}
034 * @param phrase {@link #phrase}
035 */
036 public @deserializer
037 Failure(@name("status") final String status,
038 @name("phrase") final String phrase) {
039 super(status + " " + phrase);
040 this.status = status;
041 this.phrase = phrase;
042 }
043 }