Repository: incubator-predictionio Updated Branches: refs/heads/develop fcc5a5129 -> 914c74311
[PIO-94] Fix to show stacktrace for errors thrown in `queries.json` REST API Closes #393 Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio/commit/914c7431 Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio/tree/914c7431 Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio/diff/914c7431 Branch: refs/heads/develop Commit: 914c7431178206b9cd4975ee4406ea157cd2387d Parents: fcc5a51 Author: Mars Hall <[email protected]> Authored: Tue Jun 20 16:53:28 2017 -0700 Committer: Donald Szeto <[email protected]> Committed: Tue Jun 20 16:53:28 2017 -0700 ---------------------------------------------------------------------- .../org/apache/predictionio/workflow/CreateServer.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-predictionio/blob/914c7431/core/src/main/scala/org/apache/predictionio/workflow/CreateServer.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/predictionio/workflow/CreateServer.scala b/core/src/main/scala/org/apache/predictionio/workflow/CreateServer.scala index 31b7831..8ef36e2 100644 --- a/core/src/main/scala/org/apache/predictionio/workflow/CreateServer.scala +++ b/core/src/main/scala/org/apache/predictionio/workflow/CreateServer.scala @@ -594,14 +594,14 @@ class ServerActor[Q, P]( } } catch { case e: MappingException => - log.error( - s"Query '$queryString' is invalid. Reason: ${e.getMessage}") + val msg = s"Query:\n$queryString\n\nStack Trace:\n" + + s"${getStackTraceString(e)}\n\n" + log.error(msg) args.logUrl map { url => remoteLog( url, args.logPrefix.getOrElse(""), - s"Query:\n$queryString\n\nStack Trace:\n" + - s"${getStackTraceString(e)}\n\n") + msg) } complete(StatusCodes.BadRequest, e.getMessage) case e: Throwable =>
