api/vault: Fix 404 handling and improve error messages
Vault 404 error handling needed to be updated since changes related to exception handling server side.
Also improve returned error messages, add missing test and slightly refactor tests implementation (use hypothesis instead of harcoded data).
Closes T2388
Migrated from D3125 (view on Phabricator)
Merge request reports
Activity
Build is green
Patch application report for D3125 (id=11098)
Rebasing onto 97c8291f...
Current branch diff-target is up to date.
Changes applied before test
commit 09b19ae4b94e045f22c50aae2239b2f1694455bd Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Tue May 5 16:09:28 2020 +0200 api/vault: Fix 404 handling and improve error messages Vault 404 error handling needed to be updated since changes related to exception handling server side. Also improve returned error messages, add missing test and slightly refactor tests implementation (use hypothesis instead of harcoded data). Closes [T2388](https://forge.softwareheritage.org/T2388 'view original for T2388 on Phabricator')
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/115/ for more details.
I don't know why swh-web stopped working, then.
Because of the changes regarding response handling server side I describe in https://forge.softwareheritage.org/T2388#44140 (The 404 error response was catched and
None
was returned instead of raising an exception).1090 1089 return (rev["id"], lookup_directory_with_revision(rev["id"], path, with_data)) 1091 1090 1092 1091 1092 def _vault_request(vault_fn, *args, **kwargs): 1093 try: 1094 return vault_fn(*args, **kwargs) 1095 except VaultNotFoundExc: 1096 return None With swh-vault!54 (closed), can be
except (swh.vault.exc.)NotFound
... now ;)(i may be off on the swh.vault.exception module ;)
Some references in the commit message have been migrated:
- T2388 is now swh/meta#2388 (closed)
Build is green
Patch application report for D3125 (id=11107)
Rebasing onto 97c8291f...
Current branch diff-target is up to date.
Changes applied before test
commit 5b4ba39266345d0de63a17e1eb0fd8675ab341e0 Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Tue May 5 16:09:28 2020 +0200 api/vault: Fix 404 handling and improve error messages Vault 404 error handling needed to be updated since changes related to exception handling server side. Also improve returned error messages, add missing test and slightly refactor tests implementation (use hypothesis instead of harcoded data). Closes [T2388](https://forge.softwareheritage.org/T2388 'view original for T2388 on Phabricator')
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/116/ for more details.
Build is green
Patch application report for D3125 (id=11108)
Rebasing onto 97c8291f...
Current branch diff-target is up to date.
Changes applied before test
commit affd506bc632882492a291cac08fb93886fb42e3 Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Tue May 5 16:09:28 2020 +0200 api/vault: Fix 404 handling and improve error messages Vault 404 error handling needed to be updated since changes related to exception handling server side. Also improve returned error messages, add missing test and slightly refactor tests implementation (use hypothesis instead of harcoded data). Closes [T2388](https://forge.softwareheritage.org/T2388 'view original for T2388 on Phabricator')
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/117/ for more details.