File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/custom Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 77
88package org .elasticsearch .xpack .inference .services .custom ;
99
10+ import org .apache .logging .log4j .LogManager ;
11+ import org .apache .logging .log4j .Logger ;
1012import org .elasticsearch .ElasticsearchStatusException ;
1113import org .elasticsearch .TransportVersion ;
1214import org .elasticsearch .TransportVersions ;
5254import static org .elasticsearch .xpack .inference .services .ServiceUtils .throwUnsupportedUnifiedCompletionOperation ;
5355
5456public class CustomService extends SenderService {
57+
5558 public static final String NAME = "custom" ;
5659 private static final String SERVICE_NAME = "Custom" ;
60+ private static final Logger logger = LogManager .getLogger (CustomService .class );
5761
5862 private static final EnumSet <TaskType > supportedTaskTypes = EnumSet .of (
5963 TaskType .TEXT_EMBEDDING ,
@@ -114,7 +118,7 @@ private static void validateConfiguration(CustomModel model) {
114118
115119 try {
116120 new CustomRequest (query , List .of ("test input" ), model ).createHttpRequest ();
117- } catch (Exception e ) {
121+ } catch (IllegalStateException e ) {
118122 var validationException = new ValidationException ();
119123 validationException .addValidationError (Strings .format ("Failed to validate model configuration: %s" , e .getMessage ()));
120124 throw validationException ;
You can’t perform that action at this time.
0 commit comments