Overview

Namespaces

  • LeanCloud
    • Engine
    • Operation
    • Storage
    • Uploader

Classes

  • LeanCloud\ACL
  • LeanCloud\AppRouter
  • LeanCloud\Bytes
  • LeanCloud\Client
  • LeanCloud\Engine\Cloud
  • LeanCloud\Engine\LaravelEngine
  • LeanCloud\Engine\LeanEngine
  • LeanCloud\Engine\SlimEngine
  • LeanCloud\File
  • LeanCloud\GeoPoint
  • LeanCloud\LeanObject
  • LeanCloud\MIMEType
  • LeanCloud\Operation\ArrayOperation
  • LeanCloud\Operation\DeleteOperation
  • LeanCloud\Operation\IncrementOperation
  • LeanCloud\Operation\RelationOperation
  • LeanCloud\Operation\SetOperation
  • LeanCloud\Push
  • LeanCloud\Query
  • LeanCloud\Region
  • LeanCloud\Relation
  • LeanCloud\Role
  • LeanCloud\RouteCache
  • LeanCloud\SaveOption
  • LeanCloud\SMS
  • LeanCloud\Storage\CookieStorage
  • LeanCloud\Storage\SessionStorage
  • LeanCloud\Uploader\QCloudUploader
  • LeanCloud\Uploader\QiniuUploader
  • LeanCloud\Uploader\S3Uploader
  • LeanCloud\Uploader\SimpleUploader
  • LeanCloud\User

Interfaces

  • LeanCloud\Operation\IOperation
  • LeanCloud\Storage\IStorage

Exceptions

  • LeanCloud\BatchRequestError
  • LeanCloud\CloudException
  • LeanCloud\Engine\FunctionError
  • Overview
  • Namespace
  • Class
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 
<?php
namespace LeanCloud;

/**
 * Exception thrown when cloud API returns error
 */
class CloudException extends \Exception {

    /**
     * Http status returned by API
     *
     * @var int
     */
    public $status;

    /**
     * Http method request to API
     *
     * @var string
     */
    public $method;

    /**
     * Http url request to API
     *
     * @var string
     */
    public $url;

    public function __construct($message, $code = 1, $status = 400,
                                $method=null, $url=null) {
        parent::__construct($message, $code);
        $this->status = $status;
        $this->method = $method;
        $this->url    = $url;
    }

    public function __toString() {
        $req = $this->method ? ": {$this->method} {$this->url}": "";
        return __CLASS__ . ": [{$this->code}] {$this->message}{$req}\n";
    }
}

API documentation generated by ApiGen