Skip to content

Commit

Permalink
fix: remove unnecessary whitespace and improve error logging in alert…
Browse files Browse the repository at this point in the history
…, billing, incident, and scheduled maintenance feed services
  • Loading branch information
simlarsen committed Jan 17, 2025
1 parent 854fe30 commit 102e642
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
3 changes: 0 additions & 3 deletions Common/Server/Services/AlertFeedService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export class Service extends DatabaseService<Model> {
userId?: ObjectID | undefined;
postedAt?: Date | undefined;
}): Promise<void> {

try {

if (!data.alertId) {
throw new BadDataException("Alert ID is required");
}
Expand Down Expand Up @@ -79,7 +77,6 @@ export class Service extends DatabaseService<Model> {
isRoot: true,
},
});

} catch (error) {
logger.error("AlertFeedService.createAlertFeed");
logger.error(error);
Expand Down
1 change: 0 additions & 1 deletion Common/Server/Services/BillingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ export class BillingService extends BaseService {
meteredSubscriptionId: string;
trialEndsAt?: Date | undefined;
}> {

logger.debug("Changing plan");
logger.debug(data);

Expand Down
3 changes: 0 additions & 3 deletions Common/Server/Services/IncidentFeedService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export class Service extends DatabaseService<IncidentFeed> {
userId?: ObjectID | undefined;
postedAt?: Date | undefined;
}): Promise<void> {

try {

logger.debug("IncidentFeedService.createIncidentFeed");
logger.debug(data);

Expand Down Expand Up @@ -84,7 +82,6 @@ export class Service extends DatabaseService<IncidentFeed> {

logger.debug("Incident Feed created");
logger.debug(createdIncidentFeed);

} catch (e) {
logger.error("Error in creating incident feed");
logger.error(e);
Expand Down
10 changes: 6 additions & 4 deletions Common/Server/Services/ScheduledMaintenanceFeedService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export class Service extends DatabaseService<Model> {
userId?: ObjectID | undefined;
postedAt?: Date | undefined;
}): Promise<void> {

try {

if (!data.scheduledMaintenanceId) {
throw new BadDataException("Scheduled Maintenance ID is required");
}
Expand All @@ -41,7 +39,9 @@ export class Service extends DatabaseService<Model> {
}

if (!data.scheduledMaintenanceFeedEventType) {
throw new BadDataException("Scheduled Maintenance log event is required");
throw new BadDataException(
"Scheduled Maintenance log event is required",
);
}

if (!data.projectId) {
Expand Down Expand Up @@ -82,7 +82,9 @@ export class Service extends DatabaseService<Model> {
},
});
} catch (error) {
logger.error("ScheduledMaintenanceFeedService.createScheduledMaintenanceFeed");
logger.error(
"ScheduledMaintenanceFeedService.createScheduledMaintenanceFeed",
);
logger.error(error);
// we dont want to throw the error here, as this is not critical but we still log it.
}
Expand Down

0 comments on commit 102e642

Please sign in to comment.