/** * Initializes the ServiceException using an {@link ErrorContent} object that * encapsulates most of the information about the error. Most ErrorContent * instances are declared in a subclass of {@link ErrorDomain} containing all * the errors for a GData domain (service or portion of service). */ public ServiceException(ErrorContent errorCode) { this(errorCode.getInternalReason()); this.errorElement = new ErrorElement(errorCode); }
@Override public void processEndElement() throws ParseException { if (uri == null) { throw new ParseException( CoreErrorDomain.ERR.missingSrcAttribute); } lang = xmlLang; // Validate that external content element is empty. super.processEndElement(); } }
public void processEndElement() throws ParseException { if (title == null) { throw new ParseException( CoreErrorDomain.ERR.workspaceTitleRequired); } } }
/** * Initializes the ServiceException using an {@link ErrorContent} object that * encapsulates most of the information about the error. Most ErrorContent * instances are declared in a subclass of {@link ErrorDomain} containing all * the errors for a GData domain (service or portion of service). */ public ServiceException(ErrorContent errorCode) { super(nullsafe(errorCode.getInternalReason())); httpHeaders = new HashMap<String, List<String>>(); this.errorElement = new ErrorElement(errorCode); }
/** @return the XHTML contents of this text construct */ public XmlBlob getXhtml() { if (xhtml == null) { xhtml = new XmlBlob(); // init on demand } return xhtml; } /** Specifies the XHTML contents of this text construct. */
/** * Returns a copy of this ErrorCode with the given send report URI set. * This can be used to provide a URI to which a report should be sent when * the error is received. The value will appear as the content of the * {@code sendReport} element in the XML error format. */ public ErrorCode withSendReport(String newSendReport) { return new ErrorCode( codeName, extendedHelp, internalReason, newSendReport); }
/** * Constructs a new AuthenticationException instance based upon * the contents of a WWW-Authenticate header as described by * RFC2617. */ public AuthenticationException(String message, String authHeader) { super(message); initFromAuthHeader(authHeader); }
public VersionConflictException(ErrorDomain.ErrorCode errorCode, Throwable cause) { super(errorCode, cause); setHttpErrorCodeOverride(HttpURLConnection.HTTP_CONFLICT); }
/** * Set error code. * * @throws NullPointerException if {@code code} is {@code null}. */ public void setCode(String code) { errorElement.setCode(code); }
/** * Return error location. */ public String getLocation() { return errorElement.getLocation(); }
/** * Set header name for an error in a header. * * @throws NullPointerException if {@code location} is {@code null}. */ public void setHeaderLocation(String location) { errorElement.setHeaderLocation(location); }
/** * Sets the internal reason of the error. * * @throws NullPointerException if {@code internalReason} is {@code null}. */ public void setInternalReason(String internalReason) { errorElement.setInternalReason(internalReason); }
/** * Return URI for extended help */ public String getExtendedHelp() { return errorElement.getExtendedHelp(); }
public NoLongerAvailableException(ErrorDomain.ErrorCode errorCode, Throwable cause) { super(errorCode, cause); initResponseCode(); }
public PreconditionFailedException(ErrorDomain.ErrorCode errorCode, Throwable cause) { super(errorCode, cause); initResponseCode(); }
/** * @param message */ public UnprocessableEntityException(String message) { super(message); initResponseCode(); }
@Override public void processEndElement() throws ParseException { if (uri == null) { throw new ParseException( CoreErrorDomain.ERR.missingSrcAttribute); } lang = xmlLang; // Validate that external content element is empty. super.processEndElement(); } }
/** * Initializes the ServiceException using an {@link ErrorContent} object that * encapsulates most of the information about the error, and an embedded * exception. Most ErrorContent instances are declared in a subclass of * {@link ErrorDomain} containing all the errors for this GData domain * (service or portion of service). */ public ServiceException(ErrorContent errorCode, Throwable cause) { super(nullsafe(errorCode.getInternalReason()), cause); httpHeaders = new HashMap<String, List<String>>(); this.errorElement = new ErrorElement(errorCode); }
/** * Initializes the ServiceException using an {@link ErrorContent} object that * encapsulates most of the information about the error. Most ErrorContent * instances are declared in a subclass of {@link ErrorDomain} containing all * the errors for a GData domain (service or portion of service). */ public ServiceException(ErrorContent errorCode) { this(errorCode.getInternalReason()); this.errorElement = new ErrorElement(errorCode); }
@Override public void processEndElement() throws ParseException { if (uri == null) { throw new ParseException( CoreErrorDomain.ERR.missingSrcAttribute); } lang = xmlLang; // Validate that external content element is empty. super.processEndElement(); } }