diff --git a/lib/kerror/codes/1-services.json b/lib/kerror/codes/1-services.json index af07387fd6..62f0a567d8 100644 --- a/lib/kerror/codes/1-services.json +++ b/lib/kerror/codes/1-services.json @@ -83,7 +83,7 @@ "class": "BadRequestError" }, "unknown_index_collection": { - "description": "The provided index and/or collection doesn't exist", + "description": "The provided index and/or collection doesn't exist: \"%s\"", "code": 16, "message": "The provided index and/or collection doesn't exist.", "class": "PreconditionError" diff --git a/lib/service/storage/elasticsearch.js b/lib/service/storage/elasticsearch.js index 05975f7b62..b08b73c0fd 100644 --- a/lib/service/storage/elasticsearch.js +++ b/lib/service/storage/elasticsearch.js @@ -40,6 +40,7 @@ const scopeEnum = require("../../core/storage/storeScopeEnum"); const extractFields = require("../../util/extractFields"); const { Mutex } = require("../../util/mutex"); const { randomNumber } = require("../../util/name-generator"); +const { error } = require("console"); const SCROLL_CACHE_PREFIX = "_docscroll_"; @@ -2965,7 +2966,9 @@ class ElasticSearch extends Service { }); if (body.length < 1) { - throw kerror.get(`unknown_index_collection : ${alias}`); + const getIndiceError = kerror.get("unknown_index_collection"); + debug(`${getIndiceError.message} : alias = ${alias}` ); + throw getIndiceError; } else if (body.length > 1) { throw kerror.get( "multiple_indice_alias",