I would like to nail down the error return format for the Legals Beta release, so speak up now,
and you have any improvements, send them along!


On 9/7/06, James Howe <[EMAIL PROTECTED]> wrote:
I had noticed that the error 'string' seemed to be an LzDataElement
instead of a string.  I also noticed the status code embedded in the
object.  I was hoping to avoid doing a search on the result to hunt down
the code, but if that's all that's available to me at the present time, I
guess that's what I'll use (unless I get really ambitious and fix the
underlying code and build my own 'fixed' version of OpenLaszlo).

Thanks for the confirmation.


On Thu, 07 Sep 2006 17:46:45 -0400, Henry Minsky < [EMAIL PROTECTED]>
wrote:

> Did you try looking at yourdataset.errorstring?
>
> It looks like in trunk it is not a string at all, but an XML data tree
> containing the LPS server's error response, which looks like this example
> below. The original HTTP status code is there along with some other
> junk, in
> a kind of free form format :-(
>
> I'm looking at cleaning this up in the Legals branch. I like the idea of
> some sort of structure for the error info, just not sure
> what it should look like. Probably the HTTP status code should have its
> own
> attribute, and as you mentioned before if there
> is content returned from the server in the response body, that should go
> in
> as well someplace.
>
>
>
> zx> Debug.inspect(«LzDataElement#8| <resultset><error statu...»)
> «LzDataElement#8| <resultset><error status=\"2\" msg=\"data source error
> for
> http://localhost:8080/trunk/test/lfc/data/err.jsp: HTTP Status code:
> 500:Internal Server Error\"/></resultset>» {
> attributes: «undefined»
> childNodes: [<error status="2" msg="data source error for
> http://localhost:8080/trunk/test/lfc/data/err.jsp: HTTP Status code:
> 500:Internal Server Error"/>]
> nodeName: resultset
> ownerDocument: «LzDataElement#8| <resultset><error status=\"2\"
> msg=\"data
> source error for http://localhost:8080/trunk/test/lfc/data/err.jsp: HTTP
> Status code: 500:Internal Server Error\"/></resultset>»
> rawtext: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE
> laszlo-data><resultset><error status="2" msg="data source error for
> http://localhost:8080/trunk/test/lfc/data/err.jsp: HTTP Status code:
> 500:Internal Server Error"/></resultset>
>
> }
> «LzDataElement#8| <resultset><error status=\"2\" msg=\"data source error
> for
> http://localhost:8080/trunk/test/lfc/data/err.jsp: HTTP Status code:
> 500:Internal Server Error\"/></resultset>»
> lzx>
>
> On 9/7/06, James Howe <[EMAIL PROTECTED]> wrote:I have a couple other
> comments/questions about dataset error handling.  Is
> there any way to get HTTP Status Code from a request?  I don't see
> anything in the documentation which tells me that I can.  Also, I've set
> 'getresponseheaders' to true in my dataset definition and I'm running in
> proxied mode, but I don't get any headers back when there is an error.
> Ideally, I should be able to access any information which was returned
> from the request, whether the status code indicated an error or not.
>
> Thanks!
>
> On 9/7/06, James Howe < [EMAIL PROTECTED]> wrote:
>>
>> I have a couple other comments/questions about dataset error handling.
>> Is
>> there any way to get HTTP Status Code from a request?  I don't see
>> anything in the documentation which tells me that I can.  Also, I've set
>> 'getresponseheaders' to true in my dataset definition and I'm running in
>> proxied mode, but I don't get any headers back when there is an error.
>> Ideally, I should be able to access any information which was returned
>> from the request, whether the status code indicated an error or not.
>>
>> Thanks!
>>
>> On Tue, 05 Sep 2006 11:54:40 -0400, Henry Minsky
>> <[EMAIL PROTECTED]>
>> wrote:
>>
>> > If I understand your question, you would like to get back the raw
>> content
>> > that was delivered from the backend server in a 4xx response, as
>> string
>> > data in the  dataset at the client?
>> >
>> >
>> > WEB-INF/lps/server/src/org/openlaszlo/data/HTTPDataSource.java
>> contains
>> a
>> > method called getHTTPData() which checks for the 4xx code, and it
>> calls
>> > getDataOnce() which does the actual proxied HTTP request. I need to
>> look
>> > at it more closely to see what it is doing with the returned response
>> > content. From what you are seeing, it appears it is throwing it on the
>> > floor at the moment. It
>> > certainly ought to try to package up the response body as a parameter
>> > which goes back to the client so the app can see it. I have filed a
>> > placeholder
>> > bug for this to investigate further.
>> >
>> > http://www.openlaszlo.org/jira/browse/LPP-2607
>> >
>> >
>> > On 9/5/06, James Howe < [EMAIL PROTECTED]> wrote:
>> >>
>> >> I have an OpenLaszlo application (currently running 3.2) running in
>> >> proxied mode which is using datasets to retrieve and display
>> >> information. The datasets are accessing some web services URL's which
>> >> are running on a> web server.  When the request to the web service
>> >> fails (perhaps the
>> >> information in the request was invalid, the user wasn't authorized to
>> >> perform the action, etc.) the web service returns an appropriate HTTP
>> >> status code (400, 403, etc.) along with some XML content which
>> explains
>> >> the failure. [...]
>>
>>
>>
>> --
>> James Howe
>>
>
>
>



--
James Howe



--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to