Replace CHECK in Range.h by throw std::out_of_range
authorMaxime Boucher <maxime@fb.com>
Sun, 12 May 2013 04:33:07 +0000 (21:33 -0700)
committerSara Golemon <sgolemon@fb.com>
Mon, 20 May 2013 18:01:27 +0000 (11:01 -0700)
commitc524e712ddb5632262f6c8b0b93344923c94dbbb
tree93b5f6872d95901dcb597f979a4944fdf14f3355
parentd327d57f3f825fb2ccee97d7223e311c5cf23087
Replace CHECK in Range.h by throw std::out_of_range

Summary:
Calling CHECK() in folly will force the program to abort in case of a failure.
On the other hand, for range checking, the standard library throws std::out_of_range for many functions.

Thus it could be a good idea to throw the same exception in folly so that errors can be handled using try {} catch (...) {} blocks.

Test Plan:
from fbcode, type:
fbconfig -r folly; fbmake opt -j32; fbmake runtests_opt -j 32

What other tests should I run?

Reviewed By: tudorb@fb.com

FB internal diff: D808204
folly/Range.h