The turtle stops, spews out the "Unexpected Error" message I built into the program multiple times into the console and ends the program if it hits a cave midway and there is no block underneath it.
My code is available here:
pastebin get nKy2QuPX
or
Spoiler
Thanks for your help.











