From 13566f6b8b153b1c004034986319bad66f7653b7 Mon Sep 17 00:00:00 2001 From: takapi327 Date: Wed, 1 Jan 2025 19:02:20 +0900 Subject: [PATCH] Action sbt scalafmtAll --- .../ldbc-dsl/src/main/scala/ldbc/dsl/ResultSetConsumer.scala | 3 ++- .../scala/ldbc/dsl/exception/DecodeFailureException.scala | 4 ++-- .../src/main/scala/ldbc/dsl/exception/LdbcException.scala | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/ldbc-dsl/src/main/scala/ldbc/dsl/ResultSetConsumer.scala b/module/ldbc-dsl/src/main/scala/ldbc/dsl/ResultSetConsumer.scala index e01d14ecd..b94df516a 100644 --- a/module/ldbc-dsl/src/main/scala/ldbc/dsl/ResultSetConsumer.scala +++ b/module/ldbc-dsl/src/main/scala/ldbc/dsl/ResultSetConsumer.scala @@ -56,7 +56,8 @@ object ResultSetConsumer: if resultSet.next() then decoder.decode(resultSet, FIRST_OFFSET) match case Right(value) => Monad[F].pure(Some(value)) - case Left(error) => ev.raiseError(new DecodeFailureException(error.message, decoder.offset, statement, error.cause)) + case Left(error) => + ev.raiseError(new DecodeFailureException(error.message, decoder.offset, statement, error.cause)) else Monad[F].pure(None) given [F[_]: Monad, T, G[_]](using diff --git a/module/ldbc-dsl/src/main/scala/ldbc/dsl/exception/DecodeFailureException.scala b/module/ldbc-dsl/src/main/scala/ldbc/dsl/exception/DecodeFailureException.scala index 19762d3e8..e19b493fd 100644 --- a/module/ldbc-dsl/src/main/scala/ldbc/dsl/exception/DecodeFailureException.scala +++ b/module/ldbc-dsl/src/main/scala/ldbc/dsl/exception/DecodeFailureException.scala @@ -13,7 +13,7 @@ class DecodeFailureException( message: String, offset: Int, statement: String, - cause: Option[Throwable] = None + cause: Option[Throwable] = None ) extends LdbcException( message, cause.map(_ => s""" @@ -23,7 +23,7 @@ class DecodeFailureException( | ${ Console.GREEN + statement + Console.RESET } |""".stripMargin), cause.map(_ => - s"""${ Console.CYAN }Try building a Decoder that matches the number and type of cases to be acquired as follows. + s"""${ Console.CYAN }Try building a Decoder that matches the number and type of cases to be acquired as follows. | | given Decoder[(Int, String)] = Decoder[Int] *: Decoder[String] | ${ Console.RED + " " * 28 }^${ Console.RESET }${ Console.RED + " " * 8 }^${ Console.CYAN } diff --git a/module/ldbc-dsl/src/main/scala/ldbc/dsl/exception/LdbcException.scala b/module/ldbc-dsl/src/main/scala/ldbc/dsl/exception/LdbcException.scala index 68ad4af2b..fca43147d 100644 --- a/module/ldbc-dsl/src/main/scala/ldbc/dsl/exception/LdbcException.scala +++ b/module/ldbc-dsl/src/main/scala/ldbc/dsl/exception/LdbcException.scala @@ -43,7 +43,9 @@ class LdbcException( protected def body: String = s""" - |${ labeled(" Problem: ", message) }${ detail.map(str => "\n| Detail: " + str).getOrElse("") }${ hint.map(str => "\n| Hint: " + str).getOrElse("") } + |${ labeled(" Problem: ", message) }${ detail.map(str => "\n| Detail: " + str).getOrElse("") }${ hint + .map(str => "\n| Hint: " + str) + .getOrElse("") } |""".stripMargin protected def sections: List[String] =