Upvote:2
For Catholic Church, the Holy Bible is inspired by God and infallible in matters of faith and morals, but not necessarily free from errors in its historical and scientific parts; the Vatican Council II says it "Contains without errors the truth that refers to our salvation" (Dei Verbum del 11/18/1965, n. 11, EB 686, DS 4215). The Council also specify that the correct interpretation on the Bible requires taking into account the literary genre of the biblical text and the historical and cultural context of the author/hagiographer. In particular, Gospels are considered a faithful account of the life and teaching of Jesus but that they were not composed with the intention of writing a biography, but rather to announce His saving message: therefore it is possible that the facts narrated in them and the words spoken by Jesus are not always reported exactly and accurately.
John itself says "Jesus did many other things as well. If every one of them were written down, I suppose that even the whole world would not have room for the books that would be written." (21,25)