behaviour of /search path

add exception catching and message
create tests

refs #223 refs #377
This commit is contained in:
2015-01-04 00:13:00 +01:00
parent eea91de0e0
commit a6e118f37d
8 changed files with 223 additions and 7 deletions

View File

@@ -68,7 +68,7 @@ class SearchProvider
preg_match_all('/@([a-z]+)/', $subject, $terms);
if (count($terms[0]) > 1) {
throw new ParsingException('You should not have more than one domain');
throw new ParsingException('You should not have more than one domain.');
}
//add pattern to be extracted

View File

@@ -27,8 +27,17 @@ namespace Chill\MainBundle\Search;
*/
class UnknowSearchNameException extends \Exception
{
private $name;
public function __construct($name)
{
parent::__construct( "No module search supports with the name $name");
$this->name = $name;
}
public function getName()
{
return $this->name;
}
}