@@ -60,7 +60,7 @@ namespace api06 {
60
60
if (element == " osm" )
61
61
m_context = context::top;
62
62
else
63
- throw xml_error { " Unknown top-level element, expecting osm" };
63
+ throw payload_error { " Unknown top-level element, expecting osm" };
64
64
65
65
break ;
66
66
@@ -70,7 +70,7 @@ namespace api06 {
70
70
changeset_element_found = true ;
71
71
}
72
72
else
73
- throw xml_error { " Unknown element, expecting changeset" };
73
+ throw payload_error { " Unknown element, expecting changeset" };
74
74
break ;
75
75
76
76
case context::in_changeset:
@@ -79,7 +79,7 @@ namespace api06 {
79
79
add_tag (attrs);
80
80
}
81
81
else
82
- throw xml_error { " Unknown element, expecting tag" };
82
+ throw payload_error { " Unknown element, expecting tag" };
83
83
break ;
84
84
85
85
case context::in_tag:
@@ -100,7 +100,7 @@ namespace api06 {
100
100
assert (element == " osm" );
101
101
m_context = context::root;
102
102
if (!changeset_element_found)
103
- throw xml_error { " Cannot parse valid changeset from xml string. XML doesn't contain an osm/changeset element" };
103
+ throw payload_error { " Cannot parse valid changeset from xml string. XML doesn't contain an osm/changeset element" };
104
104
break ;
105
105
case context::in_changeset:
106
106
assert (element == " changeset" );
@@ -116,7 +116,7 @@ namespace api06 {
116
116
117
117
try {
118
118
throw ;
119
- } catch (const xml_error & e) {
119
+ } catch (const payload_error & e) {
120
120
throw_with_context (e, location);
121
121
}
122
122
}
@@ -128,13 +128,13 @@ namespace api06 {
128
128
void add_tag (const std::string &key, const std::string &value) {
129
129
130
130
if (key.empty ())
131
- throw xml_error (" Key may not be empty" );
131
+ throw payload_error (" Key may not be empty" );
132
132
133
133
if (unicode_strlen (key) > 255 )
134
- throw xml_error (" Key has more than 255 unicode characters" );
134
+ throw payload_error (" Key has more than 255 unicode characters" );
135
135
136
136
if (unicode_strlen (value) > 255 )
137
- throw xml_error (" Value has more than 255 unicode characters" );
137
+ throw payload_error (" Value has more than 255 unicode characters" );
138
138
139
139
m_tags[key] = value;
140
140
@@ -166,10 +166,10 @@ namespace api06 {
166
166
});
167
167
168
168
if (!k)
169
- throw xml_error {" Mandatory field k missing in tag element" };
169
+ throw payload_error {" Mandatory field k missing in tag element" };
170
170
171
171
if (!v)
172
- throw xml_error {" Mandatory field v missing in tag element" };
172
+ throw payload_error {" Mandatory field v missing in tag element" };
173
173
174
174
add_tag (*k, *v);
175
175
}
0 commit comments