[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] LuaOAuth 0.0.5
- From: "Pierre Chapuis" <catwell@...>
- Date: Thu, 26 Sep 2013 10:32:51 +0200
>> I used it in my project  and it seems to work fine. The only detail
>> that the multipart.Request method errors if you pass
>> it a non-string or table value (see helpers.lua, line 83). It should do
>> tostring() on the value if it's not a string or table.
> Thanks, I'll take a look at it.
I have seen you have changed that here . Considering if I should change
it in lua-multipart-post as well.
I do not like the idea of calling tostring() on what is passed to that
function independently of its type. For numbers it probably makes sense,
but passing nil is almost certainly an error. And if you pass a function
you probably don't want to call tostring() on it but rather to call it and
use the result as the value...
So I think this makes the code more fragile. I would rather just deal with
numbers and keep erroring out in other cases (maybe not using error() if
you prefer to handle errors differently in your code, e.g. by returning