Not sure if you have already handled this but to go along with what Nevyn was saying...
something along the lines of this might help depending on your flow.
catch (Exception e)
if (e == REQUIRES_REBOOT_EXCEPTION)//However you determine the system should reboot
//You could inspect the exception here.
// It is not a stack trace but could provide some info
var ie = e.InnerException;
ie = ie.InnerException;
//There is another overload in case you have listeners to the OnRebootEvent