Page MenuHomePhabricator

[native][backup_client] Handle BackupNotFound in retrieve_latest_backup_info
ClosedPublic

Authored by bartek on Thu, Jan 9, 1:55 AM.
Tags
None
Referenced Files
F3892395: D14190.id46636.diff
Fri, Jan 24, 11:22 PM
F3892292: D14190.diff
Fri, Jan 24, 10:35 PM
F3888563: D14190.id46669.diff
Fri, Jan 24, 1:36 PM
Unknown Object (File)
Thu, Jan 23, 10:30 AM
Unknown Object (File)
Thu, Jan 23, 7:39 AM
Unknown Object (File)
Wed, Jan 22, 9:27 PM
Unknown Object (File)
Tue, Jan 21, 10:47 PM
Unknown Object (File)
Tue, Jan 21, 5:12 PM
Subscribers

Details

Summary

Rust part of ENG-10039

Depends on D14189

Test Plan

For:

  • user with backup
  • without backup
  • not existing user
try {
  const result = await retrieveLatestBackupInfo('username123');
  if (result === null) {
    console.log('backup not found');
  } else {
    console.log('backup found', result);
  }
} catch (e) {
  const msg = getMessageForException(e);
  if (msg === 'user_not_found') {
    console.log('user not found');
  } else {
    console.log('error: ' + msg);
  }
}
`

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Mon, Jan 13, 12:10 AM
bartek added inline comments.
shared/backup_client/src/lib.rs
401–409 ↗(On Diff #46649)

This is not perfect, I'm going to make a follow-up task to create dedicated backup error types for these and make them consistent between client and server

This revision is now accepted and ready to land.Mon, Jan 13, 1:40 AM