log
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Injectable, InternalServerErrorException, OnModuleInit, UnauthorizedException } from '@nestjs/common';
|
||||
import { Injectable, InternalServerErrorException, Logger, OnModuleInit, UnauthorizedException } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { HttpAdapterHost } from '@nestjs/core';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
@@ -23,6 +23,8 @@ type JoseImport = typeof import('jose');
|
||||
|
||||
@Injectable()
|
||||
export class OidcProviderService implements OnModuleInit {
|
||||
private readonly logger = new Logger(OidcProviderService.name);
|
||||
|
||||
private provider?: Provider;
|
||||
|
||||
constructor(
|
||||
@@ -303,7 +305,10 @@ export class OidcProviderService implements OnModuleInit {
|
||||
|
||||
for (const eventName of errorEvents) {
|
||||
eventSource.on(eventName, (ctx, error) => {
|
||||
void this.logOidcProviderError(eventName, ctx, error);
|
||||
this.logOidcProviderError(eventName, ctx, error).catch((logError) => {
|
||||
const message = logError instanceof Error ? logError.message : String(logError);
|
||||
this.logger.error(`OIDC provider error logging failed for ${eventName}: ${message}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user