|
| 1 | +/****************************************************************************/ |
| 2 | +/* File: org.expath.httpclient.HttpClientError.java */ |
| 3 | +/* Author: A. Retter - adamretter.org.uk */ |
| 4 | +/* Date: 2024-06-18 */ |
| 5 | +/* Tags: */ |
| 6 | +/* Copyright (c) 2024 Adam Retter (see end of file.) */ |
| 7 | +/* ------------------------------------------------------------------------ */ |
| 8 | + |
| 9 | + |
| 10 | +package org.expath.httpclient; |
| 11 | + |
| 12 | +import org.expath.ExpathConstants; |
| 13 | +import org.expath.ExpathError; |
| 14 | + |
| 15 | +import javax.xml.namespace.QName; |
| 16 | + |
| 17 | +/** |
| 18 | + * An error as defined by the EXPath HTTP Client specification. |
| 19 | + */ |
| 20 | +public enum HttpClientError implements ExpathError { |
| 21 | + HC001("HC01", "An HTTP error occurred"), |
| 22 | + HC002("HC02", "Error parsing the entity content as XML or HTML."), |
| 23 | + HC003("HC03", "With a multipart response, the override-media-type must be either a multipart media type or application/octet-stream."), |
| 24 | + HC004("HC04", "The src attribute on the body element is mutually exclusive with all other attribute (except the media-type)."), |
| 25 | + HC005("HC05", "The request element is not valid."), |
| 26 | + HC006("HC06", "A timeout occurred waiting for the response."); |
| 27 | + |
| 28 | + private final QName name; |
| 29 | + private final String description; |
| 30 | + |
| 31 | + HttpClientError(final String code, final String description) { |
| 32 | + this.name = new QName(ExpathConstants.ERR_NS_URI, code, ExpathConstants.ERR_NS_PREFIX); |
| 33 | + this.description = description; |
| 34 | + } |
| 35 | + |
| 36 | + @Override |
| 37 | + public QName getName() { |
| 38 | + return name; |
| 39 | + } |
| 40 | + |
| 41 | + @Override |
| 42 | + public String getDescription() { |
| 43 | + return description; |
| 44 | + } |
| 45 | +} |
| 46 | + |
| 47 | + |
| 48 | +/* ------------------------------------------------------------------------ */ |
| 49 | +/* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. */ |
| 50 | +/* */ |
| 51 | +/* The contents of this file are subject to the Mozilla Public License */ |
| 52 | +/* Version 1.0 (the "License"); you may not use this file except in */ |
| 53 | +/* compliance with the License. You may obtain a copy of the License at */ |
| 54 | +/* http://www.mozilla.org/MPL/. */ |
| 55 | +/* */ |
| 56 | +/* Software distributed under the License is distributed on an "AS IS" */ |
| 57 | +/* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */ |
| 58 | +/* the License for the specific language governing rights and limitations */ |
| 59 | +/* under the License. */ |
| 60 | +/* */ |
| 61 | +/* The Original Code is: all this file. */ |
| 62 | +/* */ |
| 63 | +/* The Initial Developer of the Original Code is Adam Retter. */ |
| 64 | +/* */ |
| 65 | +/* Contributor(s): none. */ |
| 66 | +/* ------------------------------------------------------------------------ */ |
0 commit comments