File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1111
1212namespace Symfony \UX \Icons \Registry ;
1313
14+ use Symfony \Component \HttpClient \HttpClient ;
1415use Symfony \UX \Icons \Exception \IconNotFoundException ;
1516use Symfony \UX \Icons \Icon ;
1617use Symfony \UX \Icons \IconRegistryInterface ;
@@ -38,6 +39,11 @@ public function get(string $name): Icon
3839 }
3940 }
4041
41- throw new IconNotFoundException (\sprintf ('Icon "%s" not found. ' , $ name ));
42+ $ exceptionExtra = '' ;
43+ if (str_contains ($ name , ': ' ) && !class_exists (HttpClient::class)) {
44+ $ exceptionExtra = ' If you want the on-demand registry to fetch the icon from iconfiy, you need to install "symfony/http-client". ' ;
45+ }
46+
47+ throw new IconNotFoundException (\sprintf ('Icon "%s" not found.%s ' , $ name , $ exceptionExtra ));
4248 }
4349}
You can’t perform that action at this time.
0 commit comments