Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/72527
Change subject: Include original exception when throw TimestampException
......................................................................
Include original exception when throw TimestampException
Also adjust some spaces in exception messages.
Change-Id: I7bbe70f45aea49a2caaaeba82ab64e06b96347d0
---
M includes/Timestamp.php
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/27/72527/1
diff --git a/includes/Timestamp.php b/includes/Timestamp.php
index c77f9a4..94ff2f8 100644
--- a/includes/Timestamp.php
+++ b/includes/Timestamp.php
@@ -114,7 +114,7 @@
# asctime
$strtime = $ts;
} else {
- throw new TimestampException( __METHOD__ . " : Invalid
timestamp - $ts" );
+ throw new TimestampException( __METHOD__ . ": Invalid
timestamp - $ts" );
}
if ( !$strtime ) {
@@ -126,11 +126,11 @@
try {
$final = new DateTime( $strtime, new DateTimeZone(
'GMT' ) );
} catch ( Exception $e ) {
- throw new TimestampException( __METHOD__ . ' Invalid
timestamp format.' );
+ throw new TimestampException( __METHOD__ . ': Invalid
timestamp format.', $e->getCode(), $e );
}
if ( $final === false ) {
- throw new TimestampException( __METHOD__ . ' Invalid
timestamp format.' );
+ throw new TimestampException( __METHOD__ . ': Invalid
timestamp format.' );
}
$this->timestamp = $final;
}
@@ -149,7 +149,7 @@
*/
public function getTimestamp( $style = TS_UNIX ) {
if ( !isset( self::$formats[$style] ) ) {
- throw new TimestampException( __METHOD__ . ' : Illegal
timestamp output type.' );
+ throw new TimestampException( __METHOD__ . ': Illegal
timestamp output type.' );
}
$output = $this->timestamp->format( self::$formats[$style] );
@@ -301,7 +301,7 @@
try {
$this->timestamp->setTimezone( new DateTimeZone(
$timezone ) );
} catch ( Exception $e ) {
- throw new TimestampException( __METHOD__ . ' Invalid
timezone.' );
+ throw new TimestampException( __METHOD__ . ': Invalid
timezone.', $e->getCode(), $e );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/72527
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bbe70f45aea49a2caaaeba82ab64e06b96347d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits