fix(snjs): bring back history tests and fix handlinf of error with revisions

This commit is contained in:
Karol Sójko
2023-01-20 10:02:48 +01:00
parent e61ac4c54a
commit cb9c16047e
8 changed files with 75 additions and 34 deletions

View File

@@ -29,8 +29,14 @@ export class GetRevision implements UseCaseInterface<HistoryEntry> {
}
const revisionUuid = revisionUuidOrError.getValue()
const revision = await this.revisionManager.getRevision(itemUuid, revisionUuid)
if (revision === null) {
let revision
try {
revision = await this.revisionManager.getRevision(itemUuid, revisionUuid)
} catch (error) {
return Result.fail(`Could not get revision: ${(error as Error).message}`)
}
if (!revision) {
return Result.fail('Could not get revision: Revision not found')
}