Skip to content

Commit

Permalink
Item14237: Make use of Foswiki::Object exception support
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Nov 12, 2017
1 parent e2b7108 commit dc56b65
Show file tree
Hide file tree
Showing 14 changed files with 161 additions and 143 deletions.
12 changes: 6 additions & 6 deletions core/lib/Foswiki/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3426,7 +3426,7 @@ sub readAttachment {

( $web, $topic, $attachment ) =
$this->_validateWTA( $web, $topic, $attachment );
$this->( 'Foswiki::Exception::Fatal', "Invalid attachment" )
$this->Throw( 'Foswiki::Exception::Fatal', "Invalid attachment" )
unless $attachment;

my $result;
Expand Down Expand Up @@ -3881,7 +3881,7 @@ sub saveAttachment {
my ( $web, $topic, $attachment, $data ) = @_;
( $web, $topic, $attachment ) =
$this->_validateWTA( $web, $topic, $attachment );
Foswiki::Exception::Fatal->throw( text => "Invalid attachment" )
$this->Throw( 'Foswiki::Exception::Fatal', "Invalid attachment" )
unless $attachment;

my $topicObject = $this->create(
Expand Down Expand Up @@ -3947,7 +3947,7 @@ sub moveAttachment {

( $web, $topic, $attachment ) =
$this->_validateWTA( $web, $topic, $attachment );
Foswiki::Exception::Fatal->throw( text => "Invalid attachment" )
$this->Throw( 'Foswiki::Exception::Fatal', "Invalid attachment" )
unless $attachment;

( $newWeb, $newTopic, $newAttachment ) = $this->_validateWTA(
Expand Down Expand Up @@ -4042,7 +4042,7 @@ sub copyAttachment {

( $web, $topic, $attachment ) =
$this->_validateWTA( $web, $topic, $attachment );
Foswiki::Exception::Fatal->throw( text => "Invalid attachment" )
$this->Throw( 'Foswiki::Exception::Fatal', "Invalid attachment" )
unless $attachment;

( $newWeb, $newTopic, $newAttachment ) = $this->_validateWTA(
Expand Down Expand Up @@ -4291,8 +4291,8 @@ sub expandCommonVariables {
if (DEBUG) {
for ( my $i = 4 ; $i <= 7 ; $i++ ) {
my $caller = ( caller($i) )[3];
Foswiki::Exception::Fatal->throw(
text => "expandCommonVariables called during registration" )
$this->Throw( 'Foswiki::Exception::Fatal',
"expandCommonVariables called during registration" )
if ( defined $caller
&& $caller eq 'Foswiki::Plugin::registerHandlers' );
}
Expand Down
Loading

0 comments on commit dc56b65

Please sign in to comment.