1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Better error response while resolving video link

This commit is contained in:
Maksym Pavlenko
2017-01-04 16:45:10 -08:00
parent ef749f902b
commit 2120a436d9
2 changed files with 9 additions and 3 deletions

View File

@@ -55,7 +55,13 @@ namespace Podsync.Controllers
["VideoId"] = videoId
});
return BadRequest("Could nou resolve URL");
var response = "Could nou resolve URL";
if (ex is InvalidOperationException)
{
response = ex.Message;
}
return BadRequest(response);
}
// Report metrics

View File

@@ -8,8 +8,8 @@ namespace Podsync.Services.Resolver
{
public class YtdlWrapper : IResolverService
{
private static readonly TimeSpan ProcessWaitTimeout = TimeSpan.FromSeconds(30);
private static readonly TimeSpan WaitTimeoutBetweenFailedCalls = TimeSpan.FromSeconds(15);
private static readonly TimeSpan ProcessWaitTimeout = TimeSpan.FromMinutes(1);
private static readonly TimeSpan WaitTimeoutBetweenFailedCalls = TimeSpan.FromSeconds(30);
private const string Ytdl = "youtube-dl";