mirror of
https://github.com/jely2002/youtube-dl-gui.git
synced 2021-11-01 22:46:21 +03:00
fix: report the actual error on youtube-dl returned an empty object (#55)
This commit is contained in:
@@ -47,7 +47,7 @@ class QueryManager {
|
||||
this.environment.errorHandler.raiseError({code: "Not supported", description: "Livestreams are not yet supported."}, metadataVideo.identifier);
|
||||
break;
|
||||
default:
|
||||
this.environment.errorHandler.raiseUnhandledError("Youtube-dl returned an empty object\n" + JSON.stringify(Utils.detectInfoType(initialQuery), null, 2), metadataVideo.identifier);
|
||||
//this.environment.errorHandler.raiseUnhandledError("Youtube-dl returned an empty object\n" + JSON.stringify(Utils.detectInfoType(initialQuery), null, 2), metadataVideo.identifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@ class Query {
|
||||
const {stdout} = await execa(command, args);
|
||||
return stdout
|
||||
} catch(e) {
|
||||
this.environment.errorHandler.checkError(e.stderr, this.identifier);
|
||||
console.error(e.stderr);
|
||||
this.environment.errorHandler.raiseUnhandledError("Please report this error.\n" + e.stderr, this.identifier);
|
||||
return "{}";
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -157,5 +157,5 @@ function execaMockBuilder(killed) {
|
||||
}
|
||||
|
||||
function instanceBuilder(spoofUserAgent, cookiePath, errorHandlerMock, pythonCommand) {
|
||||
return new Query({pythonCommand: pythonCommand, errorHandler: {checkError: errorHandlerMock}, paths: {ytdl: "a/path/to/ytdl"}, settings: {cookiePath: cookiePath, spoofUserAgent: spoofUserAgent}}, "test__id");
|
||||
return new Query({pythonCommand: pythonCommand, errorHandler: {checkError: errorHandlerMock, raiseUnhandledError: errorHandlerMock}, paths: {ytdl: "a/path/to/ytdl"}, settings: {cookiePath: cookiePath, spoofUserAgent: spoofUserAgent}}, "test__id");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user