Page MenuHomePhabricator

[native][backup_client] Handle BackupNotFound in retrieve_latest_backup_info
ClosedPublic

Authored by bartek on Jan 9 2025, 1:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 4, 1:55 PM
Unknown Object (File)
Sat, Mar 22, 9:26 AM
Unknown Object (File)
Sat, Mar 22, 8:52 AM
Unknown Object (File)
Mon, Mar 17, 9:08 PM
Unknown Object (File)
Mon, Mar 17, 7:19 PM
Unknown Object (File)
Sat, Mar 15, 12:21 AM
Unknown Object (File)
Sat, Mar 15, 12:21 AM
Unknown Object (File)
Sat, Mar 15, 12:21 AM
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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jan 13 2025, 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.Jan 13 2025, 1:40 AM