[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/horde/framework/Horde/Imap/Client/ -> Exception.php (source)

   1  <?php
   2  /**
   3   * Copyright 2008-2014 Horde LLC (http://www.horde.org/)
   4   *
   5   * See the enclosed file COPYING for license information (LGPL). If you
   6   * did not receive this file, see http://www.horde.org/licenses/lgpl21.
   7   *
   8   * @category  Horde
   9   * @copyright 2008-2014 Horde LLC
  10   * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
  11   * @package   Imap_Client
  12   */
  13  
  14  /**
  15   * Exception handler for the Horde_Imap_Client package.
  16   *
  17   * Additional server debug information MAY be found in the $details
  18   * property.
  19   *
  20   * @author    Michael Slusarz <slusarz@horde.org>
  21   * @category  Horde
  22   * @copyright 2008-2014 Horde LLC
  23   * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
  24   * @package   Imap_Client
  25   */
  26  class Horde_Imap_Client_Exception extends Horde_Exception_Wrapped
  27  {
  28      /* Error message codes. */
  29  
  30      /**
  31       * Unspecified error (DEFAULT).
  32       */
  33      const UNSPECIFIED = 0;
  34  
  35      /**
  36       * There was an unrecoverable error in UTF7IMAP -> UTF8 conversion.
  37       */
  38      const UTF7IMAP_CONVERSION = 3;
  39  
  40      /**
  41       * The server ended the connection.
  42       */
  43      const DISCONNECT = 4;
  44  
  45      /**
  46       * The charset used in the search query is not supported on the
  47       * server. */
  48      const BADCHARSET = 5;
  49  
  50      /**
  51       * There were errors parsing the MIME/RFC 2822 header of the part.
  52       */
  53      const PARSEERROR = 6;
  54  
  55      /**
  56       * The server could not decode the MIME part (see RFC 3516).
  57       */
  58      const UNKNOWNCTE = 7;
  59  
  60      /**
  61       * The comparator specified by setComparator() was not recognized by the
  62       * IMAP server
  63       */
  64      const BADCOMPARATOR = 9;
  65  
  66      /**
  67       * RFC 7162 [3.1.2.2] - All mailboxes are not required to support
  68       * mod-sequences.
  69       */
  70      const MBOXNOMODSEQ = 10;
  71  
  72      /**
  73       * Thrown if server denies the network connection.
  74       */
  75      const SERVER_CONNECT = 11;
  76  
  77      /**
  78       * Thrown if read error for server response.
  79       */
  80      const SERVER_READERROR = 12;
  81  
  82      /**
  83       * Thrown if write error in server interaction.
  84       */
  85      const SERVER_WRITEERROR = 16;
  86  
  87      /**
  88       * Thrown on CATENATE if the URL is invalid.
  89       */
  90      const CATENATE_BADURL = 13;
  91  
  92      /**
  93       * Thrown on CATENATE if the message was too big.
  94       */
  95      const CATENATE_TOOBIG = 14;
  96  
  97      /**
  98       * Thrown on CREATE if special-use attribute is not supported.
  99       */
 100      const USEATTR = 15;
 101  
 102      /**
 103       * The user did not have permissions to carry out the operation.
 104       */
 105      const NOPERM = 17;
 106  
 107      /**
 108       * The operation was not successful because another user is holding
 109       * a necessary resource. The operation may succeed if attempted later.
 110       */
 111      const INUSE = 18;
 112  
 113      /**
 114       * The operation failed because data on the server was corrupt.
 115       */
 116      const CORRUPTION = 19;
 117  
 118      /**
 119       * The operation failed because it exceeded some limit on the server.
 120       */
 121      const LIMIT = 20;
 122  
 123      /**
 124       * The operation failed because the user is over their quota.
 125       */
 126      const OVERQUOTA = 21;
 127  
 128      /**
 129       * The operation failed because the requested creation object already
 130       * exists.
 131       */
 132      const ALREADYEXISTS = 22;
 133  
 134      /**
 135       * The operation failed because the requested deletion object did not
 136       * exist.
 137       */
 138      const NONEXISTENT = 23;
 139  
 140      /**
 141       * Setting metadata failed because the size of its value is too large.
 142       * The maximum octet count the server is willing to accept will be
 143       * in the exception message string.
 144       */
 145      const METADATA_MAXSIZE = 24;
 146  
 147      /**
 148       * Setting metadata failed because the maximum number of allowed
 149       * annotations has already been reached.
 150       */
 151      const METADATA_TOOMANY = 25;
 152  
 153      /**
 154       * Setting metadata failed because the server does not support private
 155       * annotations on one of the specified mailboxes.
 156       */
 157      const METADATA_NOPRIVATE = 26;
 158  
 159      /**
 160       * Invalid metadata entry.
 161       */
 162      const METADATA_INVALID = 27;
 163  
 164  
 165      // Login failures
 166  
 167      /**
 168       * Could not start mandatory TLS connection.
 169       */
 170      const LOGIN_TLSFAILURE = 100;
 171  
 172      /**
 173       * Could not find an available authentication method.
 174       */
 175      const LOGIN_NOAUTHMETHOD = 101;
 176  
 177      /**
 178       * Generic authentication failure.
 179       */
 180      const LOGIN_AUTHENTICATIONFAILED = 102;
 181  
 182      /**
 183       * Remote server is unavailable.
 184       */
 185      const LOGIN_UNAVAILABLE = 103;
 186  
 187      /**
 188       * Authentication succeeded, but authorization failed.
 189       */
 190      const LOGIN_AUTHORIZATIONFAILED = 104;
 191  
 192      /**
 193       * Authentication is no longer permitted with this passphrase.
 194       */
 195      const LOGIN_EXPIRED = 105;
 196  
 197      /**
 198       * Login requires privacy.
 199       */
 200      const LOGIN_PRIVACYREQUIRED = 106;
 201  
 202  
 203      // Mailbox access failures
 204  
 205      /**
 206       * Could not open/access mailbox
 207       */
 208      const MAILBOX_NOOPEN = 200;
 209  
 210      /**
 211       * Could not complete the command because the mailbox is read-only
 212       */
 213      const MAILBOX_READONLY = 201;
 214  
 215  
 216      // POP3 specific error codes
 217  
 218      /**
 219       * Temporary issue. Generally, there is no need to alarm the user for
 220       * errors of this type.
 221       */
 222      const POP3_TEMP_ERROR = 300;
 223  
 224      /**
 225       * Permanent error indicated by server.
 226       */
 227      const POP3_PERM_ERROR = 301;
 228  
 229  
 230      // Unsupported feature error codes
 231  
 232      /**
 233       * Function/feature is not supported on this server.
 234       */
 235      const NOT_SUPPORTED = 400;
 236  
 237  
 238      /**
 239       * Raw error message (in English).
 240       *
 241       * @since 2.18.0
 242       *
 243       * @var string
 244       */
 245      public $raw_msg = '';
 246  
 247      /**
 248       * Constructor.
 249       *
 250       * @param string $msg  Error message (non-translated).
 251       * @param code $code   Error code.
 252       */
 253      public function __construct($message = null, $code = null)
 254      {
 255          parent::__construct($message, $code);
 256  
 257          $this->raw_msg = $this->message;
 258          $this->message = Horde_Imap_Client_Translation::t($this->message);
 259      }
 260  
 261      /**
 262       * Allow the error message to be altered.
 263       *
 264       * @param string $msg  Error message.
 265       */
 266      public function setMessage($msg)
 267      {
 268          $this->message = strval($msg);
 269      }
 270  
 271      /**
 272       * Allow the error code to be altered.
 273       *
 274       * @param integer $code  Error code.
 275       */
 276      public function setCode($code)
 277      {
 278          $this->code = intval($code);
 279      }
 280  
 281  }


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1