From c35c8df2b1ac0070d4b235af11f3467030149b3c Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 19 Sep 2023 14:58:13 +0100 Subject: [PATCH 1/2] Add model exception for components to start using --- .../Exception/ModelExceptionInterface.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 libraries/src/MVC/Model/Exception/ModelExceptionInterface.php diff --git a/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php b/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php new file mode 100644 index 0000000000000..95c0462665c5e --- /dev/null +++ b/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php @@ -0,0 +1,24 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\MVC\Model\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('JPATH_PLATFORM') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Interface that all exceptions stemming from the model should implement for processing by the controller. + * It is expected that the controller should catch all exceptions that implement this interface and then + * make a decision as to whether the exception can be recovered from or not. + * + * @since __DEPLOY_VERSION__ + */ +interface ModelExceptionInterface extends \Throwable +{ +} From 5cbf88d8a5fb294e7c611d2a46e8083a483041de Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 19 Sep 2023 16:14:21 +0100 Subject: [PATCH 2/2] Extra line --- libraries/src/MVC/Model/Exception/ModelExceptionInterface.php | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php b/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php index 95c0462665c5e..84223db34a57c 100644 --- a/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php +++ b/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php @@ -1,4 +1,5 @@