Skip to content
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

Remove unnecessary error generation when JsUndefined.asOpt is used #1112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ case class JsDefined(value: JsValue) extends AnyVal with JsLookupResult
* Represent a missing Json value.
*/
final class JsUndefined(err: => String) extends JsLookupResult {
def error = err
def validationError = JsonValidationError(error)
override def toString = s"JsUndefined($err)"
def error = err
def validationError = JsonValidationError(error)
override def toString = s"JsUndefined($err)"
override def asOpt[T](implicit fjs: Reads[T]): Option[T] = None
}

object JsUndefined {
Expand Down
Loading