better error handling in local build scripts