You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm coding a system with Node.JS & Express.js & Mongo DB, I can manage users in bulk. I logged in, it took some time, but I log in by taking a session and keep the access token, refresh token and expired information on the database. I can do it without any problem while performing the operation, but when the user removes the application from his profile, the application is crushed and the loop does not continue processing. I couldn't figure out how to catch the error. When the user deletes the application, when I signIn, it shows logged_in = true. Using getInfo & subscribe & like, I can detect whether the account is active or not, but when there is no user, the error that getInfo & subscribe & like translates does not originate from getInfo & subscribe & like. It returns directly from within the library.
error code:
Users/PC/Desktop/ytPanel/node_modules/youtubei.js/lib/utils/Request.js:88
throw new Utils.InnertubeError(`Request to ${res.config.url} failed with status code ${res.status} ${res.statusText}`, response);
^
Request.js 88 line:
throw new Utils.InnertubeError(`Request to ${res.config.url} failed with status code ${res.status} ${res.statusText}`,
Request.js
80 this.instance.interceptors.response.use((res) => {
81 const response = {
82 success: res.status === 200,
83 status_code: res.status,
84 data: res.data
85 };
86
87 if (res.status !== 200)
88 throw new Utils.InnertubeError(`Request to ${res.config.url} failed with status code ${res.status} ${res.statusText}`,
89 response);
90
91 return response;
92 });
When the error returns:
{
success: false,
status_code: 401,
data: {
error: {
code: 401,
message: 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.',
errors: [Array],
status: 'UNAUTHENTICATED'
}
}
}
I can't catch the error found above in my own controller file. How do I catch this error in my controller file
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm coding a system with Node.JS & Express.js & Mongo DB, I can manage users in bulk. I logged in, it took some time, but I log in by taking a session and keep the access token, refresh token and expired information on the database. I can do it without any problem while performing the operation, but when the user removes the application from his profile, the application is crushed and the loop does not continue processing. I couldn't figure out how to catch the error. When the user deletes the application, when I signIn, it shows logged_in = true. Using getInfo & subscribe & like, I can detect whether the account is active or not, but when there is no user, the error that getInfo & subscribe & like translates does not originate from getInfo & subscribe & like. It returns directly from within the library.
error code:
Request.js 88 line:
Request.js
When the error returns:
I can't catch the error found above in my own controller file. How do I catch this error in my controller file
Beta Was this translation helpful? Give feedback.
All reactions