Skip to content

Commit dbfb617

Browse files
committed
Improve logs
1 parent f24cff3 commit dbfb617

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/controllers/media.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const getLocalize = async(ctx: ParameterizedContext): Promise<Partial<Loc
4141
throw new ValidationError('Language, media type and either IMDb ID or TMDB ID are required');
4242
}
4343
if (!language.match(/^[a-z]{2}(-[a-z]{2})?$/i)) {
44-
throw new ValidationError('Language must have a minimum length of 2 and follow the case-insensitive pattern: ([a-z]{2})-([a-z]{2})');
44+
throw new ValidationError('Language must have a minimum length of 2 and follow the case-insensitive pattern: ([a-z]{2})-([a-z]{2}), received ' + language);
4545
}
4646

4747
if (mediaType !== 'collection' && mediaType !== 'movie' && mediaType !== 'tv' && mediaType !== 'tv_season' && mediaType !== 'tv_episode') {
@@ -219,7 +219,7 @@ export const getVideoV2 = async(ctx: ParameterizedContext): Promise<MediaMetadat
219219
const { episode, season, year }: UmsQueryParams = ctx.query;
220220

221221
if (!title && !imdbID) {
222-
throw new ValidationError('title or imdbId is a required parameter');
222+
throw new ValidationError(`title or imdbId is a required parameter, received title=${title}, imdbID=${imdbID}`);
223223
}
224224

225225
if (season && !episode) {

src/services/external-api-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ export const getLocalizedMetadata = async(language?: string, mediaType?: string,
451451
throw new ValidationError('Language, media type and either IMDb ID or TMDB Id are required');
452452
}
453453
if (!language.match(/^[a-z]{2}(-[a-z]{2})?$/i)) {
454-
throw new ValidationError('Language must have a minimum length of 2 and follow the case-insensitive pattern: ([a-z]{2})-([a-z]{2})');
454+
throw new ValidationError('Language must have a minimum length of 2 and follow the case-insensitive pattern: ([a-z]{2})-([a-z]{2}), received ' + language);
455455
}
456456
if (mediaType === 'tv_season' && tmdbID && !seasonNumber) {
457457
throw new ValidationError('Season number is required for season media');

0 commit comments

Comments
 (0)