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

Change subject: ApiParsoidUtils: Handle the page not existing nicely
......................................................................


ApiParsoidUtils: Handle the page not existing nicely

Change-Id: Ie1e3982ad9280e3afcafa347d88363cd8056f00b
---
M includes/api/ApiParsoidUtilsFlow.php
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/includes/api/ApiParsoidUtilsFlow.php 
b/includes/api/ApiParsoidUtilsFlow.php
index 27d0865..85fea1b 100644
--- a/includes/api/ApiParsoidUtilsFlow.php
+++ b/includes/api/ApiParsoidUtilsFlow.php
@@ -10,6 +10,12 @@
                $params = $this->extractRequestParams();
                $page = $this->getTitleOrPageId( $params );
 
+               if ( !$page->exists() ) {
+                       // ParsoidUtils::convert checks for this, but we can 
provide
+                       // a nicer error here
+                       $this->dieUsage( 'Page does not exist', 'invalid-title' 
);
+               }
+
                try {
                        $content = ParsoidUtils::convert( $params['from'], 
$params['to'], $params['content'], $page->getTitle() );
                } catch ( WikitextException $e ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1e3982ad9280e3afcafa347d88363cd8056f00b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Werdna <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to