summarylogtreecommitdiffstats
path: root/lt-ps_all_02-better-bencode-errors_all.patch
diff options
context:
space:
mode:
Diffstat (limited to 'lt-ps_all_02-better-bencode-errors_all.patch')
-rw-r--r--lt-ps_all_02-better-bencode-errors_all.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/lt-ps_all_02-better-bencode-errors_all.patch b/lt-ps_all_02-better-bencode-errors_all.patch
new file mode 100644
index 000000000000..6cfd192b70cf
--- /dev/null
+++ b/lt-ps_all_02-better-bencode-errors_all.patch
@@ -0,0 +1,40 @@
+diff --git a/src/torrent/object_raw_bencode.h b/src/torrent/object_raw_bencode.h
+index 5e82fff8..4f49386a 100644
+--- a/src/torrent/object_raw_bencode.h
++++ b/src/torrent/object_raw_bencode.h
+@@ -156,7 +156,7 @@ public:
+ inline std::string
+ raw_bencode::as_value_string() const {
+ if (!is_value())
+- throw bencode_error("Wrong object type.");
++ throw bencode_error("Wrong object type - not a value.");
+
+ return std::string(data() + 1, size() - 2);
+ }
+@@ -164,7 +164,7 @@ raw_bencode::as_value_string() const {
+ inline raw_string
+ raw_bencode::as_raw_string() const {
+ if (!is_raw_string())
+- throw bencode_error("Wrong object type.");
++ throw bencode_error("Wrong object type - not a raw string.");
+
+ const_iterator itr = std::find(begin(), end(), ':');
+
+@@ -177,7 +177,7 @@ raw_bencode::as_raw_string() const {
+ inline raw_list
+ raw_bencode::as_raw_list() const {
+ if (!is_raw_list())
+- throw bencode_error("Wrong object type.");
++ throw bencode_error("Wrong object type - not a raw list.");
+
+ return raw_list(m_data + 1, m_size - 2);
+ }
+@@ -185,7 +185,7 @@ raw_bencode::as_raw_list() const {
+ inline raw_map
+ raw_bencode::as_raw_map() const {
+ if (!is_raw_map())
+- throw bencode_error("Wrong object type.");
++ throw bencode_error("Wrong object type - not a raw map.");
+
+ return raw_map(m_data + 1, m_size - 2);
+ }