Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/203848
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/48/203848/1
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: newchange
Gerrit-Change-Id: I864d66f250eb8d55a09eccbe98d232f7d740258b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits