internal static Exception ProcessException()

in src/Core/Vipr/odataDemo.cs [1141:1189]


        internal static Exception ProcessException(Exception ex)

        {



            if (ex is DataServiceRequestException)

            {

                var response = ((DataServiceRequestException)ex).Response.FirstOrDefault();



                if (response != null)

                {

                    return ProcessError((DataServiceRequestException)ex, ex.InnerException as DataServiceClientException, response.Headers);

                }

            }



            if (ex is DataServiceQueryException)

            {

                return ProcessError((DataServiceQueryException)ex, ex.InnerException as DataServiceClientException, ((DataServiceQueryException)ex).Response.Headers);

            }



            if (ex is DataServiceClientException)

            {

                return ProcessError(ex, (DataServiceClientException)ex, new Dictionary<string, string> { {"Content-Type", ex.Message.StartsWith("<") ? "application/xml" : "application/json"}});

            }



            return null;

        }