Mar 23, 2014; 13:27
Brad Lindsay
Re: Lasso-HTTP Problems - Was: [ANN] Lasso-HTTP Production Ready
First, just a general request for people to use Github's Issues area for
feature requests and bug reports - more visibility for Lasso the better,
and other people who run into similar issues can see how they are resolved.
Deco -
One of the reasons a 409 Conflict could have been issued is to prevent
an edit conflict - essentially one of the resource you were trying to
modify was recently modified and they don't want you to modify it again.
(For example, must credit-card APIs won't let you charge the same card
twice for the same amount in quick succession. I would check to see if
that's the issue. If you need more help troubleshooting, you can email
me the post_params off list and I can take a look.
Brad
On 3/23/14, 1:18 PM, deco rior wrote:
> Thanks,
>
> In addition with include_url I get a valid response but I am getting this with http_request
>
> An unhandled failure during a web request
> Error Code: 409
> Error Msg: Conflict
> Error Stack:
>
> )
>
> include_url(
> `https://api.madmimi.com/mailer`,
> -POSTParams=#post_params
> )
>
> OR
>
> http_request(
> `https://api.madmimi.com/mailer`,
> -POSTParams=#post_params,
> -reqMethod = `POST`
> )->response;
> On Mar 23, 2014, at 9:55 AM, Brad Lind
>
> say<brad@monkware.com> wrote:
>
>> On 3/23/14, 10:22 AM, deco rior wrote:
>>> HI, Brad:
>>>
>>> This is terrific stuff
>>>
>>> I was wondering about error reporting. I have some examples below that fail, but these could happen in production because the third-party service becomes unavailable for some reason. What are your recommendations for handling these types of errors? I am perfectly happy to have the methods not handling them, but would like to understand how you handle them in lasso 9
>> First, it's worth noting that include_url exhibits the same behavior for the cases you mention. I would handle them the same way you do in Lasso 8 - use handle or handle_error blocks:
>> http://lassoguide.com/language/error-handling.html#id2
>>
>>
>>
>>> I started testing the code. I did run into this:
>>>
>>> I entered a url that could not be found (on purpose)
>>>
>>>
>>> An unhandled failure during a web request
>>> Error Code: 6
>>> Error Msg: Couldn't resolve host name
>>> Error Stack:
>> You get this if you issue something like this where the domain name doesn't exist:
>> http_request('http://domainname.com')->response
>>
>> I don't think I would change this behavior. You're expecting an http_response, but I can't give one to you since I never received one, so it throws the proper error.
>>
>>
>>> If I enter a file that could not be found I get this (on purpose again)
>>>
>>> An unhandled failure during a web request
>>> Error Code: 500
>>> Error Msg: Internal
>>> Error Stack:
>> I'm not sure what you're doing here. If I issue a request such as this:
>> local(resp) = http_request('http://www.google.com/test1.lasso')->response
>> Where the domain name exists but the path does not, I get an http_response type back. It's statusCode is 404, as you'd expect, and it has the domain's 404 response page in the body. Are you printing out the body you received? If so, then it sounds like everything worked just fine except whatever is going on in the remote system to produce a 500 instead of a 404.
>>
>>
>> HTH,
>> Brad
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso Lasso@lists.lassosoft.com
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to:<Lasso-unsubscribe@lists.lassosoft.com>
>> Send administrative queries to<Lasso-request@lists.lassosoft.com>
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso Lasso@lists.lassosoft.com
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to:<Lasso-unsubscribe@lists.lassosoft.com>
> Send administrative queries to<Lasso-request@lists.lassosoft.com>
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>