Added better error handling for spring environment issues
This commit is contained in:
parent
b72060cd2a
commit
707b8a1b26
@ -176,8 +176,15 @@ class GroupSessionController {
|
|||||||
retryCount++
|
retryCount++
|
||||||
Thread.sleep(1_000) // Sleep for 1 second
|
Thread.sleep(1_000) // Sleep for 1 second
|
||||||
}
|
}
|
||||||
if (ipv4 != null)
|
if (ipv4 != null && this::environment.isInitialized)
|
||||||
return mapOf("ip" to ipv4, "port" to environment["local.server.port"])
|
return mapOf("ip" to ipv4, "port" to environment["local.server.port"])
|
||||||
|
else if(ipv4 == null) {
|
||||||
|
logger.error("IP Address could not be determined")
|
||||||
return mapOf("error" to "Could not determine IP Address")
|
return mapOf("error" to "Could not determine IP Address")
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
logger.error("Port could not be determined, environment not initialised")
|
||||||
|
return mapOf("error" to "Could not determine port")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -30,12 +30,10 @@ class GroupSessionControllerTest{
|
|||||||
lateinit var siteRepository: SiteRepository
|
lateinit var siteRepository: SiteRepository
|
||||||
@Mock
|
@Mock
|
||||||
lateinit var tutorRepository: TutorRepository
|
lateinit var tutorRepository: TutorRepository
|
||||||
/**
|
|
||||||
@Mock
|
@Mock
|
||||||
lateinit var observationRepository: ObservationRepository
|
lateinit var observationRepository: ObservationRepository
|
||||||
@Mock
|
@Mock
|
||||||
lateinit var personRepository: PersonRepository
|
lateinit var personRepository: PersonRepository
|
||||||
**/
|
|
||||||
|
|
||||||
@After
|
@After
|
||||||
fun tearDown() {
|
fun tearDown() {
|
||||||
|
Loading…
Reference in New Issue
Block a user