summarylogtreecommitdiffstats
path: root/lt-ps-better-bencode-errors_all.patch
blob: 6cfd192b70cfee43931849add23ea3f9b3d3bbac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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);
 }