I have simple InfoPath form. I saved it and published it successfully.
Then I added C# code to InfoPath form which will populate a text field. Now this required to start Sandbox solution feature on the farm and do I did it.
To find the error text, launch the Windows' Event Viewer and open Applications and Services -> Microsoft Office Alerts log. You might want to filter by 'Level' not-equal 'Information', filtering is on the right pane of EV.