From 8f6fac2a324c1ec2e134d144e7ef39260355b1b6 Mon Sep 17 00:00:00 2001 From: Zach Smith Date: Thu, 30 Aug 2018 13:06:32 -0700 Subject: Swap Left and Right cases in GCP Pubsub createSubscription handler (#207) --- src/main/scala/xyz/driver/core/messaging/GoogleBus.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/xyz/driver/core/messaging/GoogleBus.scala b/src/main/scala/xyz/driver/core/messaging/GoogleBus.scala index 9ee5c07..cf60e59 100644 --- a/src/main/scala/xyz/driver/core/messaging/GoogleBus.scala +++ b/src/main/scala/xyz/driver/core/messaging/GoogleBus.scala @@ -133,9 +133,9 @@ class GoogleBus( .bearer(await(getToken())) val result = await(request.send()) result.body match { - case Right(error) if result.code != 409 => // 409 <=> topic already exists - throw new NoSuchElementException(s"Error creating topic: Status code ${result.code}: ${error}") - case Left(_) => () + case Left(error) if result.code != 409 => // 409 <=> topic already exists + throw new NoSuchElementException(s"Error creating topic: Status code ${result.code}: $error") + case _ => () } } @@ -152,9 +152,9 @@ class GoogleBus( ) val result = await(request.send()) result.body match { - case Right(error) if result.code != 409 => // 409 <=> subscription already exists - throw new NoSuchElementException(s"Error creating subscription: Status code ${result.code}: ${error}") - case Left(_) => () + case Left(error) if result.code != 409 => // 409 <=> subscription already exists + throw new NoSuchElementException(s"Error creating subscription: Status code ${result.code}: $error") + case _ => () } } -- cgit v1.2.3