Also include the corresponding revision id in the exception message.
Bug: T118747
Change-Id: If3e5694f8b471045cf62d672f414446cf5365ed5
}
$content = $this->getContent( Revision::RAW );
+ $prefixedDBkey = $title->getPrefixedDBkey();
+ $revId = $this->mId;
- if ( !$content || !$content->isValid() ) {
- $t = $title->getPrefixedDBkey();
-
- throw new MWException( "Content of $t is not valid! Content model is $model" );
+ if ( !$content ) {
+ throw new MWException(
+ "Content of revision $revId ($prefixedDBkey) could not be loaded for validation!"
+ );
+ }
+ if ( !$content->isValid() ) {
+ throw new MWException(
+ "Content of revision $revId ($prefixedDBkey) is not valid! Content model is $model"
+ );
}
}