Я получаю ошибку UnexpectedNullableFound с моим приложением Scala, и я надеялся получить некоторую помощь по ее исправлению.
Ошибка: -
[error] application - Unable to log user in. An exception was thrown
java.lang.RuntimeException: Left(UnexpectedNullableFound(ColumnName(.language,Some(language)))) at anorm.MayErr$$anonfun$get$1.apply(MayErr.scala:35) ~[anorm_2.11-2.4.0.jar:2.4.0] at anorm.MayErr$$anonfun$get$1.apply(MayErr.scala:34) ~[anorm_2.11-2.4.0.jar:2.4.0] at scala.util.Either.fold(Either.scala:98) ~[scala-library-2.11.12.jar:na] at anorm.MayErr.get(MayErr.scala:34) ~[anorm_2.11-2.4.0.jar:2.4.0]
at anorm.Row$class.unsafeGet(Row.scala:103) ~[anorm_2.11-2.4.0.jar:2.4.0]
at anorm.Cursor$ResultRow.unsafeGet(Cursor.scala:77) ~[anorm_2.11-2.4.0.jar:2.4.0] at anorm.Row$class.apply(Row.scala:80) ~[anorm_2.11-2.4.0.jar:2.4.0] at anorm.Cursor$ResultRow.apply(Cursor.scala:77) ~[anorm_2.11-2.4.0.jar:2.4.0]
at models.UserModel$$anonfun$findUserByEmailAndPassword$1$$anonfun$apply$9.apply(UserModel.scala:162) ~[classes/:na]
at models.UserModel$$anonfun$findUserByEmailAndPassword$1$$anonfun$apply$9.apply(UserModel.scala:156) ~[classes/:na]
И этокод, где я думаю, что это может быть причиной этой ошибки: -
def findUserByEmailAndPassword(email: String, password: String, browserHeaders: String, ip: String): Option[SocialUser] = DB.withConnection(db) { implicit c =>
SQL"""
select * from find_user_by_email_and_password($email, $password, $browserHeaders, inet($ip))
"""().map(row => (row[Option[Long]]("id"),
row[Option[String]]("email"),
row[Option[Int]]("verification"),
row[Option[Boolean]]("on_mailing_list"),
row[Option[Boolean]]("tfa_enabled"),
row[Option[String]]("pgp"),
row[String]("language")) match {
case (Some(id: Long),
Some(email: String),
Some(verification: Int),
Some(on_mailing_list: Boolean),
Some(tfa_enabled: Boolean),
pgp: Option[String],
language: String) =>
Some(SocialUser(id, email, verification, language, on_mailing_list, tfa_enabled, pgp))
case _ =>
None
}
).head
Любая помощь будет принята с благодарностью.