bot/sendfile: fix error cases