-
Notifications
You must be signed in to change notification settings - Fork 108
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
Beginner question: error messages on decoding #317
Comments
Is this thing on? |
Yes, but it's not really the forum for questions like this. It would be easier to diagnose if we had some example JSON that you were experiencing an error with. |
I haven't been able to trace any better way of getting errors :/ There are multiple facets in this question, but I think it's good and I think it should be solved - it should probably be divided into multiple issues: Typed error model An error model could be something along the lines of: trait ArgonautError {
val description: String
}
trait ParsingError extends ArgonautError {
val lineNumber: Int
val firstCharacterPosition: Int
}
final case class UexpectedEnd(val description: String, val lineNumber: Int, val firstCharacterPosition: Int) extends ParsingError This talk covers a lot of the considerations and problems, and it might be very useful (it's been useful to me at least): https://www.youtube.com/watch?v=P8nGAo3Jp-Q Parsing errors Decoding errors |
I've been programming with Scala for a few months now, but I still don't understand how (and if) can I get a better error messages from Argonaut. Currently, I have a codec and I use it as this:
However, I never get any useful error messages when I use this. All I get is
java.lang.RuntimeException: Unable to parse MyClass json: LeftProjection(Left(String: CursorHistory(List())))
.What is the proper way to handle decoding errors?
The text was updated successfully, but these errors were encountered: