Skip to content

Commit

Permalink
no longer throwing exceptions for 404 errors in Request (refs #4556)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeelot committed Oct 14, 2012
1 parent 67c716f commit e515c27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions classes/Kohana/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -974,9 +974,10 @@ public function execute()

if ( ! $this->_route instanceof Route)
{
throw HTTP_Exception::factory(404, 'Unable to find a route to match the URI: :uri', array(
return HTTP_Exception::factory(404, 'Unable to find a route to match the URI: :uri', array(
':uri' => $this->_uri,
))->request($this);
))->request($this)
->get_response();
}

if ( ! $this->_client instanceof Request_Client)
Expand Down
5 changes: 2 additions & 3 deletions tests/kohana/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public function test_initial()

/**
* Tests that the allow_external flag prevents an external request.
*
* @expectedException HTTP_Exception_404
*
* @return null
*/
Expand All @@ -89,7 +87,8 @@ public function test_disable_external_tests()
);

$request = new Request('http://www.google.com/', array(), FALSE);
$request->execute();

$this->assertEquals(FALSE, $request->is_external());
}

/**
Expand Down

1 comment on commit e515c27

@taai
Copy link

@taai taai commented on e515c27 Oct 22, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then also get rid of * @throws HTTP_Exception_404 in line 934. ;)

Please sign in to comment.