When is it time to head to the ER?

Ms
I am dealing with the loss of a beloved family member and have become very depressed. I cry to the point of making myself vomit...but my stomach is so empty barely anything comes up.
I can barely eat or drink anything.
In the last 24 hours all I have been able to stomach is maybe 8oz of Dr Pepper.
It's like I physically can't force myself to eat or drink.
I'm almost 17 weeks pregnant.
When is it time to head to the ER.