update translations

This commit is contained in:
Luke Pulverenti
2014-04-08 00:17:18 -04:00
parent 63aea3d908
commit 2c6a9892f2
42 changed files with 245 additions and 65 deletions

View File

@@ -162,8 +162,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
/// </summary>
/// <param name="options">The options.</param>
/// <returns>Task{HttpResponseInfo}.</returns>
/// <exception cref="HttpException">
/// </exception>
public Task<HttpResponseInfo> GetResponse(HttpRequestOptions options)
{
return SendAsync(options, "GET");
@@ -174,8 +172,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
/// </summary>
/// <param name="options">The options.</param>
/// <returns>Task{Stream}.</returns>
/// <exception cref="HttpException"></exception>
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
public async Task<Stream> Get(HttpRequestOptions options)
{
var response = await GetResponse(options).ConfigureAwait(false);
@@ -322,9 +318,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
}
catch (WebException ex)
{
_logger.ErrorException("Error getting response from " + options.Url, ex);
throw new HttpException(ex.Message, ex);
throw GetException(ex, options);
}
catch (Exception ex)
{
@@ -341,6 +335,42 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
}
}
/// <summary>
/// Gets the exception.
/// </summary>
/// <param name="ex">The ex.</param>
/// <param name="options">The options.</param>
/// <returns>HttpException.</returns>
private HttpException GetException(WebException ex, HttpRequestOptions options)
{
_logger.ErrorException("Error getting response from " + options.Url, ex);
if (options.LogErrorResponseBody)
{
try
{
using (var stream = ex.Response.GetResponseStream())
{
if (stream != null)
{
using (var reader = new StreamReader(stream))
{
var msg = reader.ReadToEnd();
_logger.Error(msg);
}
}
}
}
catch
{
}
}
return new HttpException(ex.Message, ex);
}
private HttpResponseInfo GetResponseInfo(HttpWebResponse httpResponse, Stream content, long? contentLength)
{
return new HttpResponseInfo
@@ -384,10 +414,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
/// <param name="options">The options.</param>
/// <param name="postData">Params to add to the POST data.</param>
/// <returns>stream on success, null on failure</returns>
/// <exception cref="HttpException">
/// </exception>
/// <exception cref="System.ArgumentNullException">postData</exception>
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
public async Task<Stream> Post(HttpRequestOptions options, Dictionary<string, string> postData)
{
var strings = postData.Keys.Select(key => string.Format("{0}={1}", key, postData[key]));
@@ -426,8 +452,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
/// <param name="options">The options.</param>
/// <returns>Task{System.String}.</returns>
/// <exception cref="System.ArgumentNullException">progress</exception>
/// <exception cref="HttpException"></exception>
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
public async Task<string> GetTempFile(HttpRequestOptions options)
{
var response = await GetTempFileResponse(options).ConfigureAwait(false);
@@ -580,7 +604,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
if (webException != null)
{
return new HttpException(ex.Message, ex);
throw GetException(webException, options);
}
return ex;