jenkins-bot has submitted this change and it was merged.

Change subject: Throw a proper exception
......................................................................


Throw a proper exception

Change-Id: I864d66f250eb8d55a09eccbe98d232f7d740258b
---
M includes/Model/PostRevision.php
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Mattflaschen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Model/PostRevision.php b/includes/Model/PostRevision.php
index 6468368..2f2411e 100644
--- a/includes/Model/PostRevision.php
+++ b/includes/Model/PostRevision.php
@@ -5,6 +5,7 @@
 use Flow\Collection\PostCollection;
 use Flow\Container;
 use Flow\Exception\DataModelException;
+use Flow\Exception\FlowException;
 use Flow\Repository\TreeRepository;
 use Title;
 use User;
@@ -329,11 +330,11 @@
         *
         * @param UUID $postId The id of the post to find.
         * @return PostRevision|null
-        * @throws SomethingException
+        * @throws FlowException
         */
        public function getDescendant( UUID $postId ) {
                if ( $this->children === null ) {
-                       throw new Exception;
+                       throw new FlowException( 'Attempted to access post 
descendant, but children haven\'t yet been loaded.' );
                }
                foreach ( $this->children as $child ) {
                        if ( $child->getPostId()->equals( $postId ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/203848
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I864d66f250eb8d55a09eccbe98d232f7d740258b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to