502 Bad Gateway error on Azure site

I'm currently integrating a new payment system (trusted) into my site. This involves sending a jsonstring to the Trustlys server. This code works fine locally, but in my azure test environment I get a 502 error. The application seems to be broken inside a block try

, but the next block catch

doesn't fire. Consider this code:

        var postData = PrepJsonForTrustly(someSecretData);

        try
        {
            _logger.Info("attempting Deposit to trustly");  //this shows up in my logs
            var res = _client.Deposit(postData);
            _logger.Info("TrustlyDeposit successful"); //this doesn't
            return res;
        }
        catch (Exception ex)
        {
            _logger.Info("Failed Deposit to Trustly"); //and, oddly, neither does this!
            throw ex;
        }

      

Google on the issue, I found this http://blog.wouldbetheologian.com/2014/07/502-bad-gateway-error-on-azure-websites.html

Which seems to describe most of the same symmetries, except that my code works fine on localhost, the stackoverflowexception described above would crash my local server as well.

Any ideas what might be causing this? Or why isn't my catch block firing?

+3


source to share


1 answer


A possible explanation for the missing logs would be if the process fails. You checked out the eventlog.xml file (in the logFiles folder) - this is the file that writes the application event log.



+7


source







All Articles