refactor(api): add better error context when plex items fail to sync

This commit is contained in:
sct
2020-12-16 03:57:03 +00:00
parent 2948f9360e
commit f8f388db6d

View File

@@ -246,7 +246,11 @@ class JobPlexSync {
plexitem.parentRatingKey ?? plexitem.parentRatingKey ??
plexitem.ratingKey plexitem.ratingKey
}`, }`,
'error' 'error',
{
errorMessage: e.message,
plexitem,
}
); );
} }
} }
@@ -293,9 +297,10 @@ class JobPlexSync {
private log( private log(
message: string, message: string,
level: 'info' | 'error' | 'debug' = 'debug' level: 'info' | 'error' | 'debug' = 'debug',
optional?: Record<string, unknown>
): void { ): void {
logger[level](message, { label: 'Plex Sync' }); logger[level](message, { label: 'Plex Sync', ...optional });
} }
public async run(): Promise<void> { public async run(): Promise<void> {