mirror of
https://github.com/corda/corda.git
synced 2025-06-18 23:28:21 +00:00
Improved error reporting.
This commit is contained in:
@ -276,7 +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.")
|
log.error("Received response code ${conn.responseCode} from $url 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.
|
||||||
@ -286,7 +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)
|
log.error("Could not query node info at $url due to an exception.", e)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ object HttpUtils {
|
|||||||
val response = client.newCall(request).execute()
|
val response = client.newCall(request).execute()
|
||||||
|
|
||||||
if (!response.isSuccessful) {
|
if (!response.isSuccessful) {
|
||||||
logger.error("Could not fulfill HTTP request. Status Code: ${response.code()}. Message: ${response.body().string()}")
|
logger.error("Could not fulfill HTTP request of type ${request.method()} to ${request.url()}. Status Code: ${response.code()}. Message: ${response.body().string()}")
|
||||||
}
|
}
|
||||||
return response.isSuccessful
|
return response.isSuccessful
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user