What happened is your liver was overwhelmed by the sugar in your pastry. I am going to assume you ate it first thing in the morning and that you didn't have anything else to eat so proportionally this amount of sugar was very high. It's actually not a bad thing that you can't eat sweets right now, take a week or 2 to restore your proper blood sugar levels. If things persist beyond this test your blood for sugar and insulin levels.
Please let us know how you go.