[serivces] Fix error handling for retreiving from database
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:
- https://en.cppreference.com/w/cpp/error/invalid_argument
- https://en.cppreference.com/w/cpp/error/out_of_range
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.
Reviewers: geekbrother, palys-swm, varun, ashoat, jimpo
Reviewed By: palys-swm, ashoat
Subscribers: benschac, ashoat, palys-swm, Adrian, atul
Differential Revision: https://phabricator.ashoat.com/D3130