You are here

class JsonParseError in Janrain Registration 8

The error to throw when the data cannot be parsed as JSON.

Hierarchy

  • class \Drupal\janrain_capture\Exception\JsonParseError extends \Drupal\janrain_capture\Exception\RuntimeException

Expanded class hierarchy of JsonParseError

1 file declares its use of JsonParseError
JanrainCaptureApi.php in src/JanrainCaptureApi.php

File

src/Exception/JsonParseError.php, line 8

Namespace

Drupal\janrain_capture\Exception
View source
class JsonParseError extends \RuntimeException {

  /**
   * The content that was tried to be recognized as valid JSON.
   *
   * @var string
   */
  protected $content;

  /**
   * {@inheritdoc}
   */
  public function __construct(string $content) {
    parent::__construct('Error parsing JSON');
    $this->content = $content;
  }

  /**
   * {@inheritdoc}
   */
  public function getContent() : string {
    return $this->content;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
JsonParseError::$content protected property The content that was tried to be recognized as valid JSON.
JsonParseError::getContent public function
JsonParseError::__construct public function