(Scala) error handling
问题 I'm currently making a function that returns an object. But If i find something invalid in the input I want to return something to indicate that problem. I just can not wrap my head around on working this out.. What is the correct way to handle errors here? Using Options? But returning None does not specify any specific problems. Am i getting something wrong?:) case class myClass(value: Int) def myFunction(input: Int) : myClass { //return myClass if succeded //else return some error - what do