Commit d80b76c7 authored by Ranjeeth Dasineni's avatar Ranjeeth Dasineni Committed by Alecs King

revert D1471958. ParseError is not intended to be caught

Summary:
a couple of files were catching this exception and included the .cpp file :O. So we moved
to .h before realizing this was not intended to be caught. reverting the move to .h. codemod will follow.

Test Plan: fbmake -r folly && fbmake && fbmake runtests

Reviewed By: delong.j@fb.com

Subscribers: trunkagent, doug, seanc, folly-diffs@, yfeldblum

FB internal diff: D1854301

Tasks: 6245781

Signature: t1:1854301:1424375745:7e226196315fac99835752896cc5e549e91df2da
parent fc6f0a5f
......@@ -256,6 +256,26 @@ private:
serialization_opts const& opts_;
};
//////////////////////////////////////////////////////////////////////
struct ParseError : std::runtime_error {
explicit ParseError(int line)
: std::runtime_error(to<std::string>("json parse error on line ", line))
{}
explicit ParseError(int line, std::string const& context,
std::string const& expected)
: std::runtime_error(to<std::string>("json parse error on line ", line,
!context.empty() ? to<std::string>(" near `", context, '\'')
: "",
": ", expected))
{}
explicit ParseError(std::string const& msg)
: std::runtime_error("json parse error: " + msg)
{}
};
// Wraps our input buffer with some helper functions.
struct Input {
explicit Input(StringPiece range, json::serialization_opts const* opts)
......
......@@ -51,27 +51,6 @@ namespace folly {
namespace json {
//////////////////////////////////////////////////////////////////////
struct ParseError : std::runtime_error {
explicit ParseError(int line)
: std::runtime_error(to<std::string>("json parse error on line ", line))
{}
explicit ParseError(int line, std::string const& context,
std::string const& expected)
: std::runtime_error(to<std::string>("json parse error on line ", line,
!context.empty() ? to<std::string>(" near `", context, '\'')
: "",
": ", expected))
{}
explicit ParseError(std::string const& msg)
: std::runtime_error("json parse error: " + msg)
{}
};
struct serialization_opts {
explicit serialization_opts()
: allow_non_string_keys(false)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment