From cd222cc601cdd4a95eb37389afbb503167664b90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Tue, 2 Jan 2018 14:07:28 -0800 Subject: [PATCH] Mark DBError as runtime exception Some tools (e.g. PHPStorm) can trace exceptions through the call tree and show warnings when a call can throw an exception which is neither handled nor acknowledged via @throws annotation. This is quite useful but currently too noisy to use due to all methods involving some kind of DB interaction potentially throwing a DBError. To avoid false warnings, make DBError inherit from RuntimeException to signal it to such tools that it is not meant to be handled. Change-Id: I847d258791b128547e10672c5e06a9ce18458371 --- includes/libs/rdbms/exception/DBError.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/libs/rdbms/exception/DBError.php b/includes/libs/rdbms/exception/DBError.php index 2f7499bc64..50238003a2 100644 --- a/includes/libs/rdbms/exception/DBError.php +++ b/includes/libs/rdbms/exception/DBError.php @@ -21,13 +21,13 @@ namespace Wikimedia\Rdbms; -use Exception; +use RuntimeException; /** * Database error base class * @ingroup Database */ -class DBError extends Exception { +class DBError extends RuntimeException { /** @var IDatabase|null */ public $db; -- 2.20.1