.. rst-class:: phpdoctorst
.. role:: php(code)
:language: php
Exception
=========
.. php:namespace:: atk4\core
.. php:class:: Exception
.. rst-class:: phpdoc-description
| All exceptions generated by Agile Core will use this class\.
:Source:
`vendor/atk4/core/src/Exception.php#15 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L15>`_
:Parent:
:php:class:`Exception`
Summary
-------
Methods
~~~~~~~
* :php:meth:`public \_\_construct\($message, $code, $previous\)<atk4\\core\\Exception::\_\_construct\(\)>`
* :php:meth:`public setMessage\($message\)<atk4\\core\\Exception::setMessage\(\)>`
* :php:meth:`public getMyTrace\(\)<atk4\\core\\Exception::getMyTrace\(\)>`
* :php:meth:`public getColorfulText\(\)<atk4\\core\\Exception::getColorfulText\(\)>`
* :php:meth:`public getHTMLText\(\)<atk4\\core\\Exception::getHTMLText\(\)>`
* :php:meth:`public getHTML\(\)<atk4\\core\\Exception::getHTML\(\)>`
* :php:meth:`public toString\($val\)<atk4\\core\\Exception::toString\(\)>`
* :php:meth:`public getParams\(\)<atk4\\core\\Exception::getParams\(\)>`
* :php:meth:`public addMoreInfo\($param, $value\)<atk4\\core\\Exception::addMoreInfo\(\)>`
Properties
----------
.. php:attr:: public static trace2
:Source:
`vendor/atk4/core/src/Exception.php#24 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L24>`_
:Type: array
Methods
-------
.. rst-class:: public
.. php:method:: public __construct( $message="", $code=0, $previous=null)
.. rst-class:: phpdoc-description
| Constructor\.
:Source:
`vendor/atk4/core/src/Exception.php#33 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L33>`_
:Parameters:
* **$message** (string | array)
* **$code** (int)
* **$previous** (:any:`Throwable <Throwable>`)
.. rst-class:: public
.. php:method:: public setMessage( $message)
.. rst-class:: phpdoc-description
| Change message \(subject\) of a current exception\. Primary use is
| for localization purposes\.
:Source:
`vendor/atk4/core/src/Exception.php#56 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L56>`_
:Parameters:
* **$message** (string)
:Returns: $this
.. rst-class:: public
.. php:method:: public getMyTrace()
.. rst-class:: phpdoc-description
| Return trace array\.
:Source:
`vendor/atk4/core/src/Exception.php#68 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L68>`_
:Returns: array
.. rst-class:: public
.. php:method:: public getColorfulText()
.. rst-class:: phpdoc-description
| Output exception message using color sequences\.
| <exception name\>: <string\>
| <info\>
|
| trace
|
| \-\-
| <triggered by\>
:Source:
`vendor/atk4/core/src/Exception.php#86 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L86>`_
:Returns: string
.. rst-class:: public
.. php:method:: public getHTMLText()
.. rst-class:: phpdoc-description
| Similar to getColorfulText\(\) but will use raw HTML for outputting colors\.
:Source:
`vendor/atk4/core/src/Exception.php#171 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L171>`_
:Returns: string
.. rst-class:: public
.. php:method:: public getHTML()
.. rst-class:: phpdoc-description
| Output exception message using HTML block and Semantic UI formatting\. It\'s your job
| to put it inside boilerplate HTML and output, e\.g:\.
| $l = new \\atk4\\ui\\App\(\);
| $l\-\>initLayout\(\'Centered\'\);
| $l\-\>layout\-\>template\-\>setHTML\(\'Content\', $e\-\>getHTML\(\)\);
| $l\-\>run\(\);
| exit;
:Source:
`vendor/atk4/core/src/Exception.php#261 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L261>`_
:Returns: string
.. rst-class:: public
.. php:method:: public toString( $val)
.. rst-class:: phpdoc-description
| Safely converts some value to string\.
:Source:
`vendor/atk4/core/src/Exception.php#378 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L378>`_
:Parameters:
* **$val** (mixed)
:Returns: string
.. rst-class:: public
.. php:method:: public getParams()
.. rst-class:: phpdoc-description
| Follow the getter\-style of PHP Exception\.
:Source:
`vendor/atk4/core/src/Exception.php#396 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L396>`_
:Returns: array
.. rst-class:: public
.. php:method:: public addMoreInfo( $param, $value)
.. rst-class:: phpdoc-description
| Augment existing exception with more info\.
:Source:
`vendor/atk4/core/src/Exception.php#409 <https://github.com/atk4/core/blob/master/vendor/atk4/core/src/Exception.php#L409>`_
:Parameters:
* **$param** (string)
* **$value** (mixed)
:Returns: $this
|