fix: don't swallow fetch errors

Previously, it would just log "fetch failed" without any details about
the cause.
This commit is contained in:
bo0tzz 2026-08-02 14:44:28 +02:00
parent cafd6c7c0f
commit ce7f257d99
No known key found for this signature in database
2 changed files with 3 additions and 6 deletions

View file

@ -180,9 +180,7 @@ export class MachineLearningRepository {
`Machine learning request to "${url}" failed with status ${response.status}: ${response.statusText}`, `Machine learning request to "${url}" failed with status ${response.status}: ${response.statusText}`,
); );
} catch (error: Error | unknown) { } catch (error: Error | unknown) {
this.logger.warn( this.logger.warn(`Machine learning request to "${url}" failed`, error);
`Machine learning request to "${url}" failed: ${error instanceof Error ? error.message : error}`,
);
} }
this.setHealthy(url, false); this.setHealthy(url, false);

View file

@ -122,8 +122,7 @@ export class OAuthRepository {
); );
} }
this.logger.error(`OAuth login failed: ${error.message}`); this.logger.error('OAuth login failed', error);
this.logger.error(error);
throw new Error('OAuth login failed', { cause: error }); throw new Error('OAuth login failed', { cause: error });
} }
@ -222,7 +221,7 @@ export class OAuthRepository {
}, },
); );
} catch (error: any | AggregateError) { } catch (error: any | AggregateError) {
this.logger.error(`Error in OAuth discovery: ${error}`, error?.stack, error?.errors); this.logger.error('Error in OAuth discovery', error);
throw new InternalServerErrorException(`Error in OAuth discovery: ${error}`, { cause: error }); throw new InternalServerErrorException(`Error in OAuth discovery: ${error}`, { cause: error });
} }
} }