Skip to content

Commit

Permalink
Log Mattermost notifier exception
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca committed Dec 4, 2024
1 parent 55cf0db commit 12a3fac
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Infrastructure/Adapter/MattermostNotifier.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HttpService } from '@nestjs/axios';
import { BadGatewayException, Injectable } from '@nestjs/common';
import { BadGatewayException, Injectable, InternalServerErrorException } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { IMattermostNotifier } from 'src/Application/IMattermostNotifier';

Expand Down Expand Up @@ -29,7 +29,7 @@ export class MattermostNotifier implements IMattermostNotifier {

return response.data;
} catch (e) {
throw BadGatewayException;
throw new InternalServerErrorException(e);
}
}

Expand All @@ -55,12 +55,10 @@ export class MattermostNotifier implements IMattermostNotifier {
}
);

console.log(response.data);

return response.data;
} catch (e) {
console.log('--error: ', e);
throw BadGatewayException;
console.error('--error: ', e);
throw new InternalServerErrorException(e);
}
}

Expand All @@ -87,7 +85,7 @@ export class MattermostNotifier implements IMattermostNotifier {

return response.data;
} catch (e) {
throw BadGatewayException;
throw new InternalServerErrorException(e);
}
}
}

0 comments on commit 12a3fac

Please sign in to comment.