Catch invalid path in build method

The server responds with an unuseful message (server error EOF), which
happens because an empty tar file is sent over. So check in the client,
who knows why that's happening and tell the user.