Added some more error logging to Node.

This commit is contained in:
Clinton Alexander
2016-10-25 16:08:37 +01:00
parent 7eeea97653
commit fdbd67db5c

View File

@ -276,6 +276,7 @@ open class DriverDSL(
val conn = url.openConnection() as HttpURLConnection val conn = url.openConnection() as HttpURLConnection
conn.requestMethod = "GET" conn.requestMethod = "GET"
if (conn.responseCode != 200) { if (conn.responseCode != 200) {
log.error("Received response code ${conn.responseCode} from api/info during startup.")
return null return null
} }
// For now the NodeInfo is tunneled in its Kryo format over the Node's Web interface. // For now the NodeInfo is tunneled in its Kryo format over the Node's Web interface.
@ -285,6 +286,7 @@ open class DriverDSL(
om.registerModule(module) om.registerModule(module)
return om.readValue(conn.inputStream, NodeInfo::class.java) return om.readValue(conn.inputStream, NodeInfo::class.java)
} catch(e: Exception) { } catch(e: Exception) {
log.error("Could not query node info", e)
return null return null
} }
} }