Adding some error logging when selecting day

This commit is contained in:
Collin Duncan 2023-06-28 16:25:40 +02:00
parent 714f74cf63
commit bdcf1b753f
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View file

@ -11,7 +11,6 @@ import {
UseInterceptors,
ClassSerializerInterceptor,
Query,
Response,
} from '@nestjs/common'
import { InjectQueue } from '@nestjs/bull'
import { Dayjs } from 'dayjs'

View file

@ -138,6 +138,7 @@ export class BaanReserverenService {
?.waitForSelector('td.month.next')
.then((d) => d?.click())
.catch((e: Error) => {
this.loggerService.error('Failed to switch months', { error: e })
throw new RunnerNavigationMonthError(e)
})
}
@ -150,6 +151,7 @@ export class BaanReserverenService {
)
.then((d) => d?.click())
.catch((e: Error) => {
this.loggerService.error('Failed to select day', { error: e })
throw new RunnerNavigationDayError(e)
})
await this.page
@ -159,6 +161,9 @@ export class BaanReserverenService {
)}.selected`,
)
.catch((e: Error) => {
this.loggerService.error('Failed to wait for selected day', {
error: e,
})
throw new RunnerNavigationSelectionError(e)
})
}