mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix: increase timeout on tmdb validation and improve error messages
This commit is contained in:
@@ -438,12 +438,12 @@ export class TMDBMetadata {
|
||||
const url = new URL(API_BASE_URL + '/authentication');
|
||||
this.addSearchParams(url);
|
||||
const validationResponse = await makeRequest(url.toString(), {
|
||||
timeout: 2000,
|
||||
timeout: 3500,
|
||||
headers: this.getHeaders(),
|
||||
});
|
||||
if (!validationResponse.ok) {
|
||||
throw new Error(
|
||||
`Failed to validate TMDB authorisation, ensure you have set a valid access token or API key: ${validationResponse.statusText}`
|
||||
`Got HTTP error during validation, ensure a valid access token or API key was set: ${validationResponse.status} - ${validationResponse.statusText}`
|
||||
);
|
||||
}
|
||||
const validationData = (await validationResponse.json()) as {
|
||||
|
||||
@@ -434,7 +434,9 @@ export async function validateConfig(
|
||||
await tmdb.validateAuthorisation();
|
||||
} catch (error) {
|
||||
if (!options?.skipErrorsFromAddonsOrProxies) {
|
||||
throw error;
|
||||
throw new Error(
|
||||
`Failed to validate TMDB API Key/Access Token: ${error instanceof Error ? error.message : String(error)}`
|
||||
);
|
||||
}
|
||||
logger.warn(error instanceof Error ? error.message : String(error));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user