catch exceptions in precaching stage
add --maxfiles option for debugging