I am expecting my partial function to discard for input 0 , but instead it is giving match error . Will you please explain exactly why is it happening? What I am missing?

object PartialFunction extends App {
val divider : PartialFunction[Int,Int] = {
case d : Int if d != 0 => 42/d
}
println(divider(0))
//println(fraction(0))
}
divider(0)call? You should wrap it with aif (divider.isDefinedAt(0))