mirror of
https://github.com/sussy-code/providers.git
synced 2026-03-31 06:58:34 +00:00
error logging
This commit is contained in:
parent
637b3b635a
commit
d325dab162
3 changed files with 5 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue