Getting More Diagnostic Info From DBA Query Runner?

Saturday, 18 July 2015 · 7 messages · last reply 28 Jul 2015
EK
Eliot Kimber18 Jul 2015 17:17 #
I'm using the DBA web app to test and debug my Web app and underlying queries. However, when there are runtime errors it only reports the error, but not the code that produced it. Is there any way for the query runner to report what module/function/line the error resulted from? Or is that information in a log somewhere? Thanks, Eliot ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
CG
Christian Grün20 Jul 2015 07:03 #
Quoted text · Eliot Kimber · 2 lines
> However, when there are runtime errors it only reports the error, > but not the code that produced it.
Sorry, I need more information. The following query...
declare %rest:path('invalid') function local:err() {
  1 + <a/>
};
...results in the following runtime error: Stopped at (...path to webapp...), 2/6: [FORG0001] Cannot cast to xs:double: "". Stack Trace: - (...path to webapp...), 1/40
CG
Christian Grünin reply to Eliot Kimber, 20 Jul 2015, 18:5520 Jul 2015 17:32 #
Ok, I got it. The full error is returned to the client, but it is then chopped in the Javascript code. If you are interested, you could have a look at it?
Quoted text · Eliot Kimber · 51 lines
On Mon, Jul 20, 2015 at 4:55 PM, Eliot Kimber <ekimber at contrext.com> wrote: > Using the latest DBA Web app from 8.2.1 when I get an error from a query > run from the Query panel the only response I get on that page is > "[FORG0001] Cannot cast to xs:double: ""." > > Using this query: > > declare %rest:path('invalid') function local:err() { > 1 + <a/> > }; > > <result>{local:err()}</result> > > I get the full trace result if I for example try to run one of my own > RESTXQ functions and there is an error, but not in the DBA app. I'm using > the DBA app to test and debug my code (and it's very convenient for that). > > Cheers, > > E. > > > ---- > Eliot Kimber, Owner > Contrext, LLC > http://contrext.com > > > > > On 7/20/15, 12:03 AM, "Christian Grün" <christian.gruen at gmail.com> wrote: > >>> However, when there are runtime errors it only reports the error, >>> but not the code that produced it. >> >>Sorry, I need more information. The following query... >> >>declare %rest:path('invalid') function local:err() { >> 1 + <a/> >>}; >> >>...results in the following runtime error: >> >> Stopped at (...path to webapp...), 2/6: >>[FORG0001] Cannot cast to xs:double: "". >> >>Stack Trace: >>- (...path to webapp...), 1/40 >> > >
CG
Christian Grünin reply to Eliot Kimber, 20 Jul 2015, 19:4320 Jul 2015 17:53 #
Quoted text · Eliot Kimber · 2 lines
> If you can point me at the relevant code I'll put aside my distaste for > Javascript and take a look.
It should be here: https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/webapp/dba/static/js.js#L79-L85 Seems most of us share the distaste; otherwise, this code snippet would probalby look more elegant.
EK
Eliot Kimberin reply to Christian Grün, 20 Jul 2015, 07:0320 Jul 2015 18:55 #
Using the latest DBA Web app from 8.2.1 when I get an error from a query run from the Query panel the only response I get on that page is "[FORG0001] Cannot cast to xs:double: ""." Using this query:
declare %rest:path('invalid') function local:err() {
  1 + <a/>
};

<result>{local:err()}</result>
I get the full trace result if I for example try to run one of my own RESTXQ functions and there is an error, but not in the DBA app. I'm using the DBA app to test and debug my code (and it's very convenient for that). Cheers, E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
Quoted text · Christian Grün · 18 lines
On 7/20/15, 12:03 AM, "Christian Grün" <christian.gruen at gmail.com> wrote: >> However, when there are runtime errors it only reports the error, >> but not the code that produced it. > >Sorry, I need more information. The following query... > >declare %rest:path('invalid') function local:err() { > 1 + <a/> >}; > >...results in the following runtime error: > > Stopped at (...path to webapp...), 2/6: >[FORG0001] Cannot cast to xs:double: "". > >Stack Trace: >- (...path to webapp...), 1/40 >
EK
Eliot Kimberin reply to Christian Grün, 20 Jul 2015, 17:3220 Jul 2015 19:43 #
If you can point me at the relevant code I'll put aside my distaste for Javascript and take a look. Cheers, E> ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
Quoted text · Christian Grün · 63 lines
On 7/20/15, 10:32 AM, "Christian Grün" <christian.gruen at gmail.com> wrote: >Ok, I got it. The full error is returned to the client, but it is then >chopped in the Javascript code. If you are interested, you could have >a look at it? > > > >On Mon, Jul 20, 2015 at 4:55 PM, Eliot Kimber <ekimber at contrext.com> >wrote: >> Using the latest DBA Web app from 8.2.1 when I get an error from a query >> run from the Query panel the only response I get on that page is >> "[FORG0001] Cannot cast to xs:double: ""." >> >> Using this query: >> >> declare %rest:path('invalid') function local:err() { >> 1 + <a/> >> }; >> >> <result>{local:err()}</result> >> >> I get the full trace result if I for example try to run one of my own >> RESTXQ functions and there is an error, but not in the DBA app. I'm >>using >> the DBA app to test and debug my code (and it's very convenient for >>that). >> >> Cheers, >> >> E. >> >> >> ---- >> Eliot Kimber, Owner >> Contrext, LLC >> http://contrext.com >> >> >> >> >> On 7/20/15, 12:03 AM, "Christian Grün" <christian.gruen at gmail.com> >>wrote: >> >>>> However, when there are runtime errors it only reports the error, >>>> but not the code that produced it. >>> >>>Sorry, I need more information. The following query... >>> >>>declare %rest:path('invalid') function local:err() { >>> 1 + <a/> >>>}; >>> >>>...results in the following runtime error: >>> >>> Stopped at (...path to webapp...), 2/6: >>>[FORG0001] Cannot cast to xs:double: "". >>> >>>Stack Trace: >>>- (...path to webapp...), 1/40 >>> >> >> >
EK
Eliot Kimberin reply to Christian Grün, 20 Jul 2015, 17:5328 Jul 2015 17:37 #
I looked at the Javascript for this but my feeble Javascript skills were insufficient to adjust this in the small amount of time I had to work on it. I'll try to look at it again when I can. Cheers, Eliot ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
Quoted text · Christian Grün · 13 lines
On 7/20/15, 10:53 AM, "Christian Grün" <christian.gruen at gmail.com> wrote: >> If you can point me at the relevant code I'll put aside my distaste for >> Javascript and take a look. > >It should be here: > > >https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/webapp/dba >/static/js.js#L79-L85 > >Seems most of us share the distaste; otherwise, this code snippet >would probalby look more elegant. >

⚡Generated with XQuery