summarylogtreecommitdiffstats
path: root/ps-silent-catch_all.patch
blob: 7ae1ea945c682c93c3dc361fd8a948c76cccf691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- a/src/command_dynamic.cc
+++ b/src/command_dynamic.cc
@@ -425,10 +425,14 @@ system_method_list_keys(const torrent::Object::string_type& args) {
 
 torrent::Object
 cmd_catch(rpc::target_type target, const torrent::Object& args) {
+  bool silent = (args.is_list()
+              && !args.as_list().empty()
+              && args.as_list().front().is_string()
+              && args.as_list().front().as_string() == "false=");
   try {
     return rpc::call_object(args, target);
   } catch (torrent::input_error& e) {
-    lt_log_print(torrent::LOG_WARN, "Caught exception: '%s'.", e.what());
+    if (!silent) lt_log_print(torrent::LOG_WARN, "Caught exception: '%s'.", e.what());
     return torrent::Object();
   }
 }