Skip to content

Commit

Permalink
Minor fix for error message format
Browse files Browse the repository at this point in the history
  • Loading branch information
travisbrown committed Nov 4, 2015
1 parent 54b15a2 commit 5433731
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/shared/src/main/scala/io/circe/Error.scala
Expand Up @@ -10,7 +10,8 @@ case class ParsingFailure(message: String, underlying: Throwable) extends Error
}

case class DecodingFailure(message: String, history: List[HistoryOp]) extends Error {
override def getMessage: String = message + history.mkString(",")
override def getMessage: String =
if (history.isEmpty) message else s"$message: ${ history.mkString(",") }"

def withMessage(message: String): DecodingFailure = copy(message = message)
}
Expand Down

0 comments on commit 5433731

Please sign in to comment.