Ethernet Shield: Log sensor readings to SD card and serve the logs over Ethernet

When this code is present it errors at file.open()

What does "it errors at file.open" mean? What error?

What does error() do?