Skip to content

Commit

Permalink
fix(logging): don't log display_entity not finding record
Browse files Browse the repository at this point in the history
  • Loading branch information
sleidig committed Mar 13, 2024
1 parent a6e8669 commit 9bfeb71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ describe("DisplayEntityComponent", () => {
});

it("should log a warning if entity cannot be loaded", async () => {
const warnSpy = spyOn(TestBed.inject(LoggingService), "warn");
const logSpy = spyOn(TestBed.inject(LoggingService), "debug");
const child = new Child("not_existing");
component.entityId = child.getId();
component.config = School.ENTITY_TYPE;

await component.ngOnInit();

expect(warnSpy).toHaveBeenCalledWith(
expect(logSpy).toHaveBeenCalledWith(
jasmine.stringContaining(child.getId()),
);
expect(component.entityToDisplay).toBeUndefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export class DisplayEntityComponent
this.entityId,
);
} catch (e) {
this.logger.warn(
// this may be caused by restrictive permissions and therefore shouldn't be treated as a technical issue
this.logger.debug(
`[DISPLAY_ENTITY] Could not find entity with ID: ${this.entityId}: ${e}`,
);
}
Expand Down

0 comments on commit 9bfeb71

Please sign in to comment.