You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2020/10/14 03:25:26 UTC

[incubator-nlpcraft] 17/23: WIP.

This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git

commit 24062840ccbe533cd783630b65dda1ccfed45247
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Tue Oct 13 02:49:26 2020 -0700

    WIP.
---
 .../main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala  | 2 +-
 .../main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
index ce1f318..c794464 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
@@ -1711,7 +1711,7 @@ object NCCli extends App {
 
         state.probes.foreach(addProbeToTable(tbl, _))
 
-        logln(s"Connected probes:\n${tbl.toString}")
+        logln(s"Connected probes (${state.probes.size}):\n${tbl.toString}")
     }
 
     /**
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
index 33b8c2e..d57acd7 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
@@ -1838,7 +1838,7 @@ class NCBasicRestApi extends NCRestApi with LazyLogging with NCOpenCensusTrace w
 
         // General exception.
         case e: NCException ⇒
-            val errMsg = e.getLocalizedMessage
+            val errMsg = "Unexpected system error."
             val code = "NC_ERROR"
 
             // We have to log error reason because even general exceptions are not expected here.
@@ -1848,7 +1848,7 @@ class NCBasicRestApi extends NCRestApi with LazyLogging with NCOpenCensusTrace w
 
         // Unexpected errors.
         case e: Throwable ⇒
-            val errMsg = e.getLocalizedMessage
+            val errMsg = "Unexpected system error."
             val code = "NC_ERROR"
 
             U.prettyError(logger,s"Unexpected system error: $errMsg", e)
@@ -1886,7 +1886,7 @@ class NCBasicRestApi extends NCRestApi with LazyLogging with NCOpenCensusTrace w
                 case _: InvalidOriginRejection ⇒ complete(s"Invalid origin.")
 
                 // Common case.
-                case err: Rejection ⇒ complete(s"Bad request.")
+                case _: Rejection ⇒ complete(s"Bad request.")
             }.result
     }