1 <?php
2 /*
3 Copyright (c) 2012, University of Cambridge Computing Service
4
5 This file is part of the Lookup/Ibis client library.
6
7 This library is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 require_once "IbisDto.php";
22
23 /**
24 * Class representing an error returned by the web service API.
25 *
26 * @author Dean Rasheed (dev-group@ucs.cam.ac.uk)
27 */
28 class IbisError extends IbisDto
29 {
30 /* Properties marked as @XmlAttribte in the JAXB class */
31 protected static $xmlAttrs = array("status");
32
33 /* Properties marked as @XmlElement in the JAXB class */
34 protected static $xmlElems = array("code", "message", "details");
35
36 /** @var int The HTTP error status code. */
37 public $status;
38
39 /** @var string A short textual description of the error status code. */
40 public $code;
41
42 /**
43 * @var string A short textual description of the error message
44 * (typically one line).
45 */
46 public $message;
47
48 /**
49 * @var string The full details of the error (e.g., a Java stack trace).
50 */
51 public $details;
52
53 /**
54 * @ignore
55 * Create an IbisError from the attributes of an XML node.
56 *
57 * @param array $attrs The attributes on the XML node.
58 */
59 public function __construct($attrs=array())
60 {
61 parent::__construct($attrs);
62 if (isset($this->status))
63 $this->status = (int )$this->status;
64 }
65 }
66