add try/except blocks to build script