Skip to content

JP - Provides additional runtime information #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Evaluator(timeout: FiniteDuration = 20.seconds)(
result ← Try(eval.execute[T](code, resetState = true, jars = jars))
} yield result

val errors = eval.errors.toMap.asInstanceOf[EvalResult.CI]
val errors = eval.errors

result match {
case scala.util.Success(r) ⇒ EvalSuccess[T](errors, r, "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ object services {
) flatMap {
result =>
val response = result match {
case EvalSuccess(cis, result, out) =>
case EvalSuccess(cis, res, out) =>
EvalResponse(
`ok`,
Option(result.toString),
Option(result.asInstanceOf[AnyRef].getClass.getName),
Option(res.toString),
Option(res.asInstanceOf[AnyRef].getClass.getName),
cis)
case Timeout(_) =>
EvalResponse(`Timeout Exceded`, None, None, Map.empty)
Expand All @@ -56,8 +56,12 @@ object services {
None,
None,
Map.empty)
case EvalRuntimeError(cis, _) =>
EvalResponse(`Runtime Error`, None, None, cis)
case EvalRuntimeError(cis, runtimeError) =>
EvalResponse(
`Runtime Error`,
runtimeError map (_.error.getMessage),
runtimeError map (_.error.getClass.getName),
cis)
case CompilationError(cis) =>
EvalResponse(`Compilation Error`, None, None, cis)
case GeneralError(err) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class EvalEndpointSpec extends FunSpec with Matchers {
),
`X-Scala-Eval-Api-Token`(validToken)),
expectedStatus = HttpStatus.Ok,
expectedValue = None,
expectedValue = Some("true was not false"),
expectedMessage = `Runtime Error`
)
}
Expand Down