ContentRenderer
1 month ago
class-html2text-exception.php
10 months ago
class-html2text.php
10 months ago
class-renderer.php
1 month ago
interface-css-inliner.php
1 year ago
template-canvas.css
1 month ago
template-canvas.php
1 month ago
class-html2text-exception.php
47 lines
| 1 | <?php |
| 2 | /** |
| 3 | * HTML to Text Exception class |
| 4 | * |
| 5 | * This file was extracted from the `soundasleep/html2text` package. |
| 6 | * Copyright (c) 2019 Jevon Wright |
| 7 | * MIT License |
| 8 | * |
| 9 | * @package Automattic\WooCommerce\EmailEditor |
| 10 | */ |
| 11 | |
| 12 | declare( strict_types = 1 ); |
| 13 | |
| 14 | namespace Automattic\WooCommerce\EmailEditor\Engine\Renderer; |
| 15 | |
| 16 | /** |
| 17 | * Exception thrown when HTML to text conversion fails |
| 18 | */ |
| 19 | class Html2Text_Exception extends \Exception { |
| 20 | /** |
| 21 | * Additional information about the error |
| 22 | * |
| 23 | * @var string |
| 24 | */ |
| 25 | private string $more_info; |
| 26 | |
| 27 | /** |
| 28 | * Constructor |
| 29 | * |
| 30 | * @param string $message Error message. |
| 31 | * @param string $more_info Additional error information. |
| 32 | */ |
| 33 | public function __construct( string $message = '', string $more_info = '' ) { |
| 34 | parent::__construct( $message ); |
| 35 | $this->more_info = $more_info; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Returns additional error information |
| 40 | * |
| 41 | * @return string Additional error information. |
| 42 | */ |
| 43 | public function get_more_info(): string { |
| 44 | return $this->more_info; |
| 45 | } |
| 46 | } |
| 47 |