Skip to content
Snippets Groups Projects
Commit 2e3253c8 authored by Ludovic Claude's avatar Ludovic Claude
Browse files

Log and report errors

parent ab1565c5
No related branches found
No related tags found
No related merge requests found
...@@ -56,13 +56,13 @@ public class MiningApi { ...@@ -56,13 +56,13 @@ public class MiningApi {
try { try {
result = (QueryResult) Await.result(future, timeout.duration()); result = (QueryResult) Await.result(future, timeout.duration());
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("Cannot receive algorithm result from woken !"); LOGGER.error("Cannot receive algorithm result from woken: " + e.getMessage(), e);
LOGGER.trace(e.getMessage());
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE).build(); return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE).build();
} }
if (result.error().nonEmpty()) { if (result.error().nonEmpty()) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(result.error().get()); LOGGER.error(result.error().get());
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"error\":\"" + result.error().get() + "\"}");
} else { } else {
return ResponseEntity.ok(result.data().get()); return ResponseEntity.ok(result.data().get());
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment