Page MenuHomePhabricator

[serivces] Fix error handling for retreiving from database
ClosedPublic

Authored by karol on Feb 8 2022, 12:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 7, 4:07 PM
Unknown Object (File)
Thu, Jan 2, 8:41 AM
Unknown Object (File)
Thu, Jan 2, 8:41 AM
Unknown Object (File)
Thu, Jan 2, 8:40 AM
Unknown Object (File)
Thu, Jan 2, 8:36 AM
Unknown Object (File)
Nov 15 2024, 7:27 AM
Unknown Object (File)
Nov 12 2024, 8:01 PM
Unknown Object (File)
Nov 12 2024, 8:01 PM

Details

Summary

We want to catch logic_error instead of std::out_of_range when dealing with stoll.
This is because stoll may throw two different errors:

Both of them inherit from logic_error https://en.cppreference.com/w/cpp/error/logic_error

Test Plan

You may want to intentionally trigger each of these errors and see if the code catches them.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

karol edited the summary of this revision. (Show Details)
karol edited the test plan for this revision. (Show Details)
karol added reviewers: max, tomek, varun.
karol added inline comments.
services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.cpp
36–42 ↗(On Diff #9361)

we don't even use stoll here

This revision is now accepted and ready to land.Feb 8 2022, 8:45 AM
This revision now requires review to proceed.Feb 8 2022, 8:45 AM
ashoat added a reviewer: jim.
This revision is now accepted and ready to land.Feb 8 2022, 9:28 PM