Added error catching to tb.getFileContents