1<?php 2 3namespace Sabre\DAV; 4 5/** 6 * Main Exception class. 7 * 8 * This class defines a getHTTPCode method, which should return the appropriate HTTP code for the Exception occurred. 9 * The default for this is 500. 10 * 11 * This class also allows you to generate custom xml data for your exceptions. This will be displayed 12 * in the 'error' element in the failing response. 13 * 14 * @copyright Copyright (C) fruux GmbH (https://fruux.com/) 15 * @author Evert Pot (http://evertpot.com/) 16 * @license http://sabre.io/license/ Modified BSD License 17 */ 18class Exception extends \Exception { 19 20 /** 21 * Returns the HTTP statuscode for this exception 22 * 23 * @return int 24 */ 25 function getHTTPCode() { 26 27 return 500; 28 29 } 30 31 /** 32 * This method allows the exception to include additional information into the WebDAV error response 33 * 34 * @param Server $server 35 * @param \DOMElement $errorNode 36 * @return void 37 */ 38 function serialize(Server $server, \DOMElement $errorNode) { 39 40 41 } 42 43 /** 44 * This method allows the exception to return any extra HTTP response headers. 45 * 46 * The headers must be returned as an array. 47 * 48 * @param Server $server 49 * @return array 50 */ 51 function getHTTPHeaders(Server $server) { 52 53 return []; 54 55 } 56 57} 58