Skip to content

Implementation of the new IR API #26

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 12 commits into from
Oct 21, 2018
Merged
Prev Previous commit
Replaced usage of 'try-catch' with 'Try' (codestyle)
  • Loading branch information
Johannes Duesing committed Oct 21, 2018
commit 66353b5c1ba8fbd0fe04a7285e01c4df0afbac05
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,9 @@ object InstanceRegistry extends JsonSupport with AppLogging
}

def postInstance(instance : Instance, uri: String) () : Future[HttpResponse] = {
try {
val request = HttpRequest(method = HttpMethods.POST, uri = uri, entity = instance.toJson(instanceFormat).toString())
Http(system).singleRequest(request)
} catch {
case dx: DeserializationException =>
Try(HttpRequest(method = HttpMethods.POST, uri = uri, entity = instance.toJson(instanceFormat).toString())) match {
case Success(request) => Http(system).singleRequest(request)
case Failure(dx) =>
log.warning(s"Failed to deregister to Instance Registry, exception: $dx")
Future.failed(dx)
}
Expand Down