mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 16:53:24 +00:00
error logging
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
"homepage": "https://github.com/movie-web/providers#readme",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"test": "vitest run --coverage",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"lint": "eslint --ext .ts,.js src/",
|
||||
|
@@ -3,6 +3,7 @@ export type UpdateEventStatus = 'success' | 'failure' | 'notfound' | 'pending';
|
||||
export type UpdateEvent = {
|
||||
percentage: number;
|
||||
status: UpdateEventStatus;
|
||||
error?: unknown;
|
||||
};
|
||||
|
||||
export type InitEvent = {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { UseableFetcher } from '@/fetchers/types';
|
||||
import { FullScraperEvents } from '@/main/events';
|
||||
import { ScrapeMedia } from '@/main/media';
|
||||
import { ProviderList } from '@/providers/all';
|
||||
import { EmbedOutput, SourcererOutput } from '@/providers/base';
|
||||
import { ProviderList } from '@/providers/get';
|
||||
import { Stream } from '@/providers/streams';
|
||||
import { ScrapeContext } from '@/utils/context';
|
||||
import { NotFoundError } from '@/utils/errors';
|
||||
@@ -85,8 +85,8 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
|
||||
ops.events?.update?.({
|
||||
percentage: 100,
|
||||
status: 'failure',
|
||||
error: err,
|
||||
});
|
||||
// TODO log error
|
||||
continue;
|
||||
}
|
||||
if (!output) throw new Error('Invalid media type');
|
||||
@@ -139,8 +139,8 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
|
||||
ops.events?.update?.({
|
||||
percentage: 100,
|
||||
status: 'failure',
|
||||
error: err,
|
||||
});
|
||||
// TODO log error
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user