Skip to content

Commit

Permalink
PR review feedback, part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jportner committed Nov 4, 2021
1 parent ee325f7 commit ed54e64
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/core/server/saved_objects/service/lib/repository.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,9 @@ describe('SavedObjectsRepository', () => {
await savedObjectsRepository.delete(MULTI_NAMESPACE_ISOLATED_TYPE, id, { namespace });
expect(client.get).toHaveBeenCalledTimes(1);
expect(logger.error).toHaveBeenCalledTimes(1);
expect(logger.error).toHaveBeenCalledWith('Oh no!');
expect(logger.error).toHaveBeenCalledWith(
'Unable to delete aliases when deleting an object: Oh no!'
);
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/saved_objects/service/lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ export class SavedObjectsRepository {
}).catch((err) => {
// The object has already been deleted, but we caught an error when attempting to delete aliases.
// A consumer cannot attempt to delete the object again, so just log the error and swallow it.
this._logger.error(err.message);
this._logger.error(`Unable to delete aliases when deleting an object: ${err.message}`);
});
}
return {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,9 @@ describe('#updateObjectsSpaces', () => {
expectBulkArgs({ action: 'update', object: { ...obj1, namespaces: [space2] } });
expect(mockDeleteLegacyUrlAliases).toHaveBeenCalledTimes(1); // don't assert deleteLegacyUrlAliases args, we have tests for that above
expect(params.logger.error).toHaveBeenCalledTimes(1);
expect(params.logger.error).toHaveBeenCalledWith('Oh no!');
expect(params.logger.error).toHaveBeenCalledWith(
'Unable to delete aliases when unsharing an object: Oh no!'
);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export async function updateObjectsSpaces({
}).catch((err) => {
// The object has already been unshared, but we caught an error when attempting to delete aliases.
// A consumer cannot attempt to unshare the object again, so just log the error and swallow it.
logger.error(err.message);
logger.error(`Unable to delete aliases when unsharing an object: ${err.message}`);
});
await pMap(objectsToDeleteAliasesFor, mapper, { concurrency: MAX_CONCURRENT_ALIAS_DELETIONS });

Expand Down

0 comments on commit ed54e64

Please sign in to comment.