| @@ 331-337 (lines=7) @@ | ||
| 328 | if ( !$storeStatus->isOK() ) { |
|
| 329 | $error = $storeStatus->getErrorsArray(); |
|
| 330 | $error = reset( $error ); |
|
| 331 | if ( !count( $error ) ) { |
|
| 332 | $error = $storeStatus->getWarningsArray(); |
|
| 333 | $error = reset( $error ); |
|
| 334 | if ( !count( $error ) ) { |
|
| 335 | $error = [ 'unknown', 'no error recorded' ]; |
|
| 336 | } |
|
| 337 | } |
|
| 338 | throw new UploadChunkFileException( "Error storing file in '$chunkPath': " . |
|
| 339 | implode( '; ', $error ) ); |
|
| 340 | } |
|
| @@ 258-264 (lines=7) @@ | ||
| 255 | // which is probably useless to the caller. |
|
| 256 | $error = $storeStatus->getErrorsArray(); |
|
| 257 | $error = reset( $error ); |
|
| 258 | if ( !count( $error ) ) { |
|
| 259 | $error = $storeStatus->getWarningsArray(); |
|
| 260 | $error = reset( $error ); |
|
| 261 | if ( !count( $error ) ) { |
|
| 262 | $error = [ 'unknown', 'no error recorded' ]; |
|
| 263 | } |
|
| 264 | } |
|
| 265 | // At this point, $error should contain the single "most important" |
|
| 266 | // error, plus any parameters. |
|
| 267 | $errorMsg = array_shift( $error ); |
|