Overview

Namespaces

  • Contentstack
    • Error
    • Result
    • Stack
      • ContentType
        • BaseQuery
        • Entry
        • Query
    • Utility
  • None

Classes

  • Contentstack\Contentstack
  • Contentstack\Result\Result
  • Contentstack\Stack\ContentType\BaseQuery\BaseQuery
  • Contentstack\Stack\ContentType\ContentType
  • Contentstack\Stack\ContentType\Entry\Entry
  • Contentstack\Stack\ContentType\Query\Query
  • Contentstack\Stack\Stack

Exceptions

  • Contentstack\Error\CSException

Functions

  • addBoolean
  • comparision
  • contains
  • Contentstack\Utility\debug
  • Contentstack\Utility\generateQuery
  • Contentstack\Utility\generateQueryParams
  • Contentstack\Utility\getDomain
  • Contentstack\Utility\getLastActivites
  • Contentstack\Utility\headers
  • Contentstack\Utility\isEmpty
  • Contentstack\Utility\isKeySet
  • Contentstack\Utility\request
  • Contentstack\Utility\URL
  • Contentstack\Utility\validateInput
  • Contentstack\Utility\wrapResult
  • createError
  • existence
  • getFunctionName
  • language
  • logical
  • pagination
  • projection
  • references
  • regexp
  • search
  • sorting
  • tags
  • Overview
  • Namespace
  • Class
 1: <?php
 2: namespace Contentstack\Error;
 3: 
 4: /*
 5:  * CSException
 6:  * CSException Class is used to wrap the REST API error
 7:  **/
 8: class CSException extends \Exception {
 9:     var $error_message;
10:     var $error_code;
11:     var $http_code;
12: 
13:     function __construct($error, $http_code = 412) {
14:         $error = json_decode($error, true);
15:         $this->error_message = (isset($error['error_message'])) ? $error['error_message'] : "It seems Built.io Contentstack is behaving badly. Please contact support@contentstack.io.";
16:         $this->error_code    = (isset($error['error_code'])) ? $error['error_code'] : null;
17:         $this->errors        = (isset($error['errors'])) ? $error['errors'] : array();
18:         $this->http_code     = $http_code;
19:         parent::__construct($this->error_message, $this->error_code, null);
20:     }
21: 
22:     /*
23:      * getStatusCode
24:      * To get http status_code of the current exception
25:      * @return HttpCode|string
26:      * */
27:     function getStatusCode() {
28:         return $this->http_code;
29:     }
30: 
31:     /*
32:      * getErrors
33:      * Returns error details of current exception
34:      * @return error|array
35:      * */
36:     function getErrors() {
37:         return $this->errors;
38:     }
39: }
API documentation generated by ApiGen