Add error handling for out-of-tree build