We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 135f0c6 commit 42711f2Copy full SHA for 42711f2
1 file changed
QencodeApiClient.js
@@ -53,7 +53,20 @@ class QencodeApiClient {
53
}
54
55
CreateTask(){
56
- let response = this.Request("create_task", {token: this.AccessToken });
+ let response = null;
57
+ while (1) {
58
+ try {
59
+ response = this.Request("create_task", {token: this.AccessToken});
60
+ break;
61
+ }
62
+ catch (err) {
63
+ if (err.message == "Token not found") {
64
+ // console.log("Refreshing access token...");
65
+ this.getAccessToken();
66
67
+ else throw(err);
68
69
70
return new TranscodingTask(this, response.task_token, response.upload_url);
71
72
0 commit comments