r94797 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94796‎ | r94797 | r94798 >
Date:19:22, 17 August 2011
Author:reedy
Status:ok
Tags:
Comment:
Use default as a fall through like it is for error
Modified paths:
  • /trunk/extensions/PoolCounter/PoolCounterClient_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PoolCounter/PoolCounterClient_body.php
@@ -128,10 +128,6 @@
129129 $parts = explode( ' ', $response, 2 );
130130 $responseType = $parts[0];
131131 switch ( $responseType ) {
132 - case 'ERROR':
133 - $parts = explode( ' ', $parts[1], 2 );
134 - $errorMsg = isset( $parts[1] ) ? $parts[1] : '(no message given)';
135 - return Status::newFatal( 'poolcounter-remote-error', $errorMsg );
136132 case 'LOCKED':
137133 case 'RELEASED':
138134 case 'DONE':
@@ -140,6 +136,12 @@
141137 case 'TIMEOUT':
142138 case 'LOCK_HELD':
143139 return Status::newGood( constant( "PoolCounter::$responseType" ) );
 140+
 141+ case 'ERROR':
 142+ default:
 143+ $parts = explode( ' ', $parts[1], 2 );
 144+ $errorMsg = isset( $parts[1] ) ? $parts[1] : '(no message given)';
 145+ return Status::newFatal( 'poolcounter-remote-error', $errorMsg );
144146 }
145147 }
146148

Status & tagging log