File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1+ pr : 113266
2+ summary : " [M] Fix error message formatting"
3+ area : Machine Learning
4+ type : bug
5+ issues : []
Original file line number Diff line number Diff line change 2020
2121public class ExceptionsHelper {
2222
23+ private static String NO_KNOWN_MODEL_ERROR =
24+ "No known trained model with model_id [{}], you may need to create it or load it into the cluster with eland" ;
25+
2326 private ExceptionsHelper () {}
2427
2528 public static ResourceNotFoundException missingJobException (String jobId ) {
@@ -51,19 +54,11 @@ public static ResourceNotFoundException missingModelDeployment(String deployment
5154 }
5255
5356 public static ResourceNotFoundException missingTrainedModel (String modelId ) {
54- return new ResourceNotFoundException (
55- "No known trained model with model_id [{}], you may need to create it or load it into the cluster with eland" ,
56- modelId
57- );
57+ return new ResourceNotFoundException (NO_KNOWN_MODEL_ERROR , modelId );
5858 }
5959
6060 public static ResourceNotFoundException missingTrainedModel (String modelId , Exception cause ) {
61- return new ResourceNotFoundException (
62- "Failure due to [{}]. No known trained model with model_id [{}], "
63- + "you may need to create it or load it into the cluster with eland" ,
64- cause ,
65- modelId
66- );
61+ return new ResourceNotFoundException (NO_KNOWN_MODEL_ERROR , cause , modelId );
6762 }
6863
6964 public static ElasticsearchException serverError (String msg ) {
You can’t perform that action at this time.
0 commit comments