@@ -29,7 +29,7 @@ Value http_create_headers(std::vector<Value>& n, VM* vm [[maybe_unused]])
2929Value http_create_client (std::vector<Value>& n, VM* vm [[maybe_unused]])
3030{
3131 if (!types::check (n, ValueType::String, ValueType::Number))
32- types::generateError (
32+ throw types::TypeCheckingError (
3333 " http:client" ,
3434 { { types::Contract { { types::Typedef (" host" , ValueType::String), types::Typedef (" port" , ValueType::Number) } } } },
3535 n);
@@ -189,7 +189,7 @@ Value http_client_patch(std::vector<Value>& n, VM* vm [[maybe_unused]])
189189Value http_client_set_follow_location (std::vector<Value>& n, VM* vm [[maybe_unused]])
190190{
191191 if ((!types::check (n, ValueType::User, ValueType::True) && !types::check (n, ValueType::User, ValueType::False)) || !n[0 ].usertypeRef ().is <Client>())
192- types::generateError (
192+ throw types::TypeCheckingError (
193193 " http:setFollowLocation" ,
194194 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User), types::Typedef (" value" , ValueType::True) } },
195195 types::Contract { { types::Typedef (" httpClient" , ValueType::User), types::Typedef (" value" , ValueType::False) } } } },
@@ -202,7 +202,7 @@ Value http_client_set_follow_location(std::vector<Value>& n, VM* vm [[maybe_unus
202202Value http_client_set_co_timeout (std::vector<Value>& n, VM* vm [[maybe_unused]])
203203{
204204 if (!types::check (n, ValueType::User, ValueType::Number, ValueType::Number) || !n[0 ].usertype ().is <Client>())
205- types::generateError (
205+ throw types::TypeCheckingError (
206206 " http:setConnectionTimeout" ,
207207 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
208208 types::Typedef (" seconds" , ValueType::Number),
@@ -219,7 +219,7 @@ Value http_client_set_co_timeout(std::vector<Value>& n, VM* vm [[maybe_unused]])
219219Value http_client_set_read_timeout (std::vector<Value>& n, VM* vm [[maybe_unused]])
220220{
221221 if (!types::check (n, ValueType::User, ValueType::Number, ValueType::Number) || !n[0 ].usertype ().is <Client>())
222- types::generateError (
222+ throw types::TypeCheckingError (
223223 " http:setReadTimeout" ,
224224 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
225225 types::Typedef (" seconds" , ValueType::Number),
@@ -236,7 +236,7 @@ Value http_client_set_read_timeout(std::vector<Value>& n, VM* vm [[maybe_unused]
236236Value http_client_set_write_timeout (std::vector<Value>& n, VM* vm [[maybe_unused]])
237237{
238238 if (!types::check (n, ValueType::User, ValueType::Number, ValueType::Number) || !n[0 ].usertype ().is <Client>())
239- types::generateError (
239+ throw types::TypeCheckingError (
240240 " http:setWriteTimeout" ,
241241 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
242242 types::Typedef (" seconds" , ValueType::Number),
@@ -253,7 +253,7 @@ Value http_client_set_write_timeout(std::vector<Value>& n, VM* vm [[maybe_unused
253253Value http_client_set_basic_auth (std::vector<Value>& n, VM* vm [[maybe_unused]])
254254{
255255 if (!types::check (n, ValueType::User, ValueType::String, ValueType::String) || !n[0 ].usertype ().is <Client>())
256- types::generateError (
256+ throw types::TypeCheckingError (
257257 " http:setBasicAuth" ,
258258 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
259259 types::Typedef (" username" , ValueType::String),
@@ -269,7 +269,7 @@ Value http_client_set_basic_auth(std::vector<Value>& n, VM* vm [[maybe_unused]])
269269Value http_client_set_bearer_token_auth (std::vector<Value>& n, VM* vm [[maybe_unused]])
270270{
271271 if (!types::check (n, ValueType::User, ValueType::String) || !n[0 ].usertype ().is <Client>())
272- types::generateError (
272+ throw types::TypeCheckingError (
273273 " http:setBearerTokenAuth" ,
274274 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
275275 types::Typedef (" token" , ValueType::String) } } } },
@@ -282,7 +282,7 @@ Value http_client_set_bearer_token_auth(std::vector<Value>& n, VM* vm [[maybe_un
282282Value http_client_set_keep_alive (std::vector<Value>& n, VM* vm [[maybe_unused]])
283283{
284284 if ((!types::check (n, ValueType::User, ValueType::True) && !types::check (n, ValueType::User, ValueType::False)) || !n[0 ].usertype ().is <Client>())
285- types::generateError (
285+ throw types::TypeCheckingError (
286286 " http:setKeepAlive" ,
287287 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
288288 types::Typedef (" toggle" , ValueType::True) } },
@@ -297,7 +297,7 @@ Value http_client_set_keep_alive(std::vector<Value>& n, VM* vm [[maybe_unused]])
297297Value http_client_set_proxy (std::vector<Value>& n, VM* vm [[maybe_unused]])
298298{
299299 if (!types::check (n, ValueType::User, ValueType::String, ValueType::Number) || !n[0 ].usertype ().is <Client>())
300- types::generateError (
300+ throw types::TypeCheckingError (
301301 " http:setProxy" ,
302302 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
303303 types::Typedef (" host" , ValueType::String),
@@ -311,7 +311,7 @@ Value http_client_set_proxy(std::vector<Value>& n, VM* vm [[maybe_unused]])
311311Value http_client_set_proxy_basic_auth (std::vector<Value>& n, VM* vm [[maybe_unused]])
312312{
313313 if (!types::check (n, ValueType::User, ValueType::String, ValueType::String) || !n[0 ].usertype ().is <Client>())
314- types::generateError (
314+ throw types::TypeCheckingError (
315315 " http:setProxyBasicAuth" ,
316316 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
317317 types::Typedef (" username" , ValueType::String),
@@ -328,7 +328,7 @@ Value http_client_set_proxy_basic_auth(std::vector<Value>& n, VM* vm [[maybe_unu
328328Value http_client_set_proxy_bearer_token_auth (std::vector<Value>& n, VM* vm [[maybe_unused]])
329329{
330330 if (!types::check (n, ValueType::User, ValueType::String) || !n[0 ].usertype ().is <Client>())
331- types::generateError (
331+ throw types::TypeCheckingError (
332332 " http:setProxyBearerTokenAuth" ,
333333 { { types::Contract { { types::Typedef (" httpClient" , ValueType::User),
334334 types::Typedef (" token" , ValueType::String) } } } },
0 commit comments