mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 08:33:49 +00:00
behaviour of /search path
add exception catching and message create tests refs #223 refs #377
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user