r41581 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41580‎ | r41581 | r41582 >
Date:00:19, 3 October 2008
Author:aaron
Status:old
Tags:
Comment:
Pretty up exception handling a tad
Modified paths:
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -47,9 +47,12 @@
4848 $view = new CodeRevisionStatusView( $params[0], $params[2] );
4949 break;
5050 } else {
51 - throw new MWException( "Unexpected number of parameters" );
 51+ # Nonsense param, back out
 52+ $view = new CodeRevisionListView( $params[0] );
 53+ break;
5254 }
5355 case 4:
 56+ default:
5457 if( $params[2] == 'reply' ) {
5558 $view = new CodeRevisionView( $params[0], $params[1], $params[3] );
5659 break;
@@ -60,8 +63,7 @@
6164 $view = new CodeRevisionStatusSetter( $params[0], $params[1] );
6265 break;
6366 }
64 - default:
65 - throw new MWException( "Unexpected number of parameters" );
 67+ throw new MWException( "Invalid action specified" );
6668 }
6769 }
6870 $view->execute();

Status & tagging log