Elastacloud.AzureManagement.Fluent.Commands.Services.ServiceCommand.ErrorResponseCallback C# (CSharp) Method

ErrorResponseCallback() protected method

The error callback exception that will be attached to if the response presents a failure of some sort - to be routed to a notification interface of a certain type
protected ErrorResponseCallback ( WebException exception ) : void
exception System.Net.WebException The web exception as it stands
return void
        protected virtual void ErrorResponseCallback(WebException exception)
        {
            // do a simple trace here
            string message = string.Format("Error with status code: {0} and type: {1}",
                                           ((int) exception.Status).ToString(CultureInfo.InvariantCulture),
                                           exception.Status.ToString());
            Trace.TraceError(message, exception);
            // add NLog support for the exception
            Trace.TraceError(exception.Message);
            // TODO: Place and error router here

            // if we have an error it's probably best to release this
            _exception = exception;
            SitAndWait.Set();
            // rethrow this otherwise we'll lose this
        }