Error 500 on Deployed site but not in Visual Studio

Hi,

I have implemented some customer search code and it works as expected in Visual Studio, but once the sites deployed all I get when I go to the search page is a 500 Error. I can’t see any thing in the logs to say what causing the error any one any ideas where I can start looking.

Or is there any way to add login in to the Razor page it self so I can see how far through the code it gets before it dies on it ass!!!

Thanks

Darren

Can you provide some more information?

We are using Umbraco 13 Latest Build

here the code I been using:

ISearchResults results = pageSearch.genericSearchExamine(searchQuery);

Above is been problamatical

var results2 = publishedContentQuery.Search(searchQuery).ToList();

This works but also shows some odd results when it comes to who edited it, For exaple you say search for Alex it would show all the pages that Alex has edited.

I am trying to lock the search down to content only not editors , crators ect showing the in the search.

I put try atching is and I am getting this>


c__DisplayClass10_0.<b__0>d.MoveNext()

Now seen this before.

It turned out after a lot of checking an investigating it was throwing the error due to nulls. Now I put null checks in that fixed it.,