public static ErrorMessage ErrorMessageFromException(Exception ex)
        {
            var m = new ErrorMessage();
            m.Message = ex.Message;
            m.Response = ex.ToString();

            return m;
        }
        public static async Task<ErrorMessage> ErrorFromResponseAsync(HttpWebResponse response)
        {
            ErrorMessage m = new ErrorMessage();
            m.StatusCode = (int)response.StatusCode;
            m.Message = response.StatusDescription;

            using (var stream = response.GetResponseStream())
            {
                StreamReader reader = new StreamReader(stream);
                m.Response = await reader.ReadToEndAsync();
            }

            return m;
        }