It sounds like you did well and acted fast to calm the situation down.
Happenings like this can be valuable learning experiences for both you, the student and the class. From what we have heard from our senior teachers, we would suggest creating a system that can give you more information about the students’ moods.
For example, for that particular student, you could employ a card system, where they discretely show you a signal that they’re about to blow. This will allow you to give them an errand to run, or let them get a drink of water, without making a song and dance out of it for the rest of the class.
Holistically, you could also employ a check-in system for the class. Perhaps a diagram of a volcano with their names on it, and the students can display their moods at the start of the class. There are a lot things that are out of your control as teachers, so getting information about your students’ lives outside of the classroom and how its affecting their mood, will always improve your approach as a teacher.