Thank for reaching out. AFAIK there is no such out of box feature for custom failing a dataflow and writing error message.
A possible way you could try is by using a validation activity to check the file size > 0 before executing your data flow activity. If the validation is true then execute dataflow activity, and if validation is false then you can send an email by triggering a logic app from ADF as explained in this blog : Send Notifications from an Azure Data Factory Pipeline
If you have a feature request suggestion related to this requirement, please feel free to share it in ADF user voice forum: https://feedback.azure.com/forums/270578-data-factory/
Hope this info helps.
Thank you
Please do consider to click on "Accept Answer" and "Upvote" on the post that helps you, as it can be beneficial to other community members.