In Scala you return a Validation that is either a value or an error, and can pattern match on it. Also: trySomething().orElse("Default value")