summarylogtreecommitdiffstats
path: root/ps-silent-catch_all.patch
blob: 550e742770ccb92b8670b31b655f6cde975f1962 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- a/src/command_dynamic.cc
+++ b/src/command_dynamic.cc
@@ -415,10 +415,15 @@ system_method_list_keys(const torrent::O
 
 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();
   }
 }