diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-01-28 13:46:04 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-01-30 19:11:03 +0100 |
commit | 0364024781ffa709a1a86ae9c6638f71df0317ca (patch) | |
tree | 7fde4d205b81d4fb65a07736d95fb1a09d746022 /include/qpdf/QPDFJob.hh | |
parent | 764feb0f8e0b7753c2d3efe644561220acbc771c (diff) | |
download | qpdf-0364024781ffa709a1a86ae9c6638f71df0317ca.tar.zst |
Use QPDFUsage exception for cli, json, and QPDFJob errors
Diffstat (limited to 'include/qpdf/QPDFJob.hh')
-rw-r--r-- | include/qpdf/QPDFJob.hh | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh index 076501ff..e56626a7 100644 --- a/include/qpdf/QPDFJob.hh +++ b/include/qpdf/QPDFJob.hh @@ -43,15 +43,8 @@ class QPDFWriter; class QPDFJob { public: - // ConfigError exception is thrown if there are any usage-like - // errors when calling Config methods. - class QPDF_DLL_CLASS ConfigError: public std::runtime_error - { - public: - QPDF_DLL - ConfigError(std::string const&); - }; - + // QPDFUsage is thrown if there are any usage-like errors when + // calling Config methods. QPDF_DLL QPDFJob(); @@ -318,7 +311,9 @@ class QPDFJob friend class Config; // Return a top-level configuration item. See CONFIGURATION above - // for details. + // for details. If an invalid configuration is created (such as + // supplying contradictory options, omitting an input file, etc.), + // QPDFUsage is thrown. QPDF_DLL std::shared_ptr<Config> config(); @@ -404,6 +399,7 @@ class QPDFJob }; // Helper functions + static void usage(std::string const& msg); static JSON json_schema(std::set<std::string>* keys = 0); static void parse_object_id( std::string const& objspec, bool& trailer, int& obj, int& gen); |