Recently when I was trying to change the theme of a SharePoint online site collection, it threw an error “There was an error while attempting to get the themes”
Found out that the javascript with c# code needs to be out of the tag which has runat=”server”. After checking the code I re-wrote the code into 2 pieces
While I was modifying SharePoint’s master page to put an inline code, I was constantly redirected to SharePoint Error Page “An unexpected error has occurred”.
After spending nearly an hour to get a clue from EventLog and other sources, I found out that by adding the following config codes to web.config of the web application where the site collection resides, we can see the ASP.NET error page with detailed information.