diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js index de6ab589780a4..f61a79ca9de66 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.js +++ b/src/core/server/saved_objects/service/lib/repository.test.js @@ -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!' + ); }); }); diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index 389bf1e4833c8..d538690fb1920 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -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 {}; diff --git a/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts b/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts index e3e0349c2c742..d5b79b70a55a1 100644 --- a/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts +++ b/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts @@ -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!' + ); }); }); }); diff --git a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts index cd25f142d8ef3..90e914b9796c3 100644 --- a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts +++ b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts @@ -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 });