On our Onan 4000 Genset, if it stops running unexpectedly, I hold down the stop/prime button for a few seconds and let go (after it signifies that it has been primed), it will flash 2 sets of codes. For instance it may flash 3 times then flash 4 times. I would take that code to the section on troubleshooting in the Owners Manual and find out what that code means.
Fortunately, we've only had issues once with our Genset. The code was a generic code about an internal problem, but it was under warranty so took it to the dealer. Turned out to be a bad fuel pump on a brand new unit. Haven't had problems since.
-Michael