Errors that shouldn't be

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Errors that shouldn't be

Justin Will
I am receiving some errors that don't make any sense to me.  I  have the following code in a page.

<%
C_Longint($vnID)
$vnID:=Num(_query{"id"})
%>

I am occasionally getting the following error from this code.

An operation on incompatible types was attempted (expected a numeric expression or a text expression or a boolean expression)

My Query params are:
id: 150672
sessionid: 501357412-9696-30768

How in the world is this an error?  I have seen similar errors on several pages

Here's the error info:

Error Classification: 6

Error Description: An operation on incompatible types was attempted (expected a numeric expression or a text expression or a boolean expression)

Error Path: /40015/register.html

Error Source Method:

Error Before Token: $vnID:=Num(_query{"id"

Error Token: }

Error After Token: )

Error Err Code: 0


Thanks
Justin

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Errors that shouldn't be

Aparajita Fishman
That is indeed strange. You say it only happens occasionally? It isn't reproducible?


> On Nov 20, 2015, at 4:05 PM, Justin Will <[hidden email]> wrote:
>
> I am receiving some errors that don't make any sense to me.  I  have the following code in a page.
>
> <%
> C_Longint($vnID)
> $vnID:=Num(_query{"id"})
> %>
>
> I am occasionally getting the following error from this code.
>
> An operation on incompatible types was attempted (expected a numeric expression or a text expression or a boolean expression)
>
> My Query params are:
> id: 150672
> sessionid: 501357412-9696-30768
>
> How in the world is this an error?  I have seen similar errors on several pages
>
> Here's the error info:
>
> Error Classification: 6
>
> Error Description: An operation on incompatible types was attempted (expected a numeric expression or a text expression or a boolean expression)
>
> Error Path: /40015/register.html
>
> Error Source Method:
>
> Error Before Token: $vnID:=Num(_query{"id"
>
> Error Token: }
>
> Error After Token: )
>
> Error Err Code: 0
>
>
> Thanks
> Justin
>
> _______________________________________________
> Active4D-dev mailing list
> [hidden email]
> http://list.aparajitaworld.com/listinfo/active4d-dev
> Archives: http://active4d-nabble.aparajitaworld.com/

Regards,

  Aparajita


_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Errors that shouldn't be

Michael Larue-2
In reply to this post by Justin Will
Saturday, November 21, 2015 at 2:16:08 AM

Just for fun, what happens if you break it into several steps?

<%
C_TEXT($vTemp)
$vTemp:=_query{"id"}
C_LONGINT($vnID)
$vnID:=Num($vTemp)
%>

Still get the error?

Also, try restarting the web server and/or computer; sometimes that might clear up weirdness.

Cheers!

Michael Larue

--------------

On Nov 21, 2015, at 1:05 AM, Justin Will <[hidden email]> wrote:

> I am receiving some errors that don't make any sense to me.  I  have the following code in a page.
>
> <%
> C_Longint($vnID)
> $vnID:=Num(_query{"id"})
> %>
>
> I am occasionally getting the following error from this code.
>
> An operation on incompatible types was attempted (expected a numeric expression or a text expression or a boolean expression)
>
> My Query params are:
> id: 150672
> sessionid: 501357412-9696-30768
>
> How in the world is this an error?  I have seen similar errors on several pages
>
> Here's the error info:
>
> Error Classification: 6
>
> Error Description: An operation on incompatible types was attempted (expected a numeric expression or a text expression or a boolean expression)
>
> Error Path: /40015/register.html
>
> Error Source Method:
>
> Error Before Token: $vnID:=Num(_query{"id"
>
> Error Token: }
>
> Error After Token: )
>
> Error Err Code: 0
>
>
> Thanks
> Justin
>
> _______________________________________________
> Active4D-dev mailing list
> [hidden email]
> http://list.aparajitaworld.com/listinfo/active4d-dev
> Archives: http://active4d-nabble.aparajitaworld.com/

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Errors that shouldn't be

Justin Will
In reply to this post by Justin Will
I am not able to reproduce this at will.  I had calls about it the last couple of days but could not make it happen myself.  I since created an error page that emails me whenever an  error happens and I am getting about 1 email an hour with moderate traffic.  The computer reboots itself every night at 3am already so I think the idea of it "clear itself up" with a reboot may already be covered.

The really strange part is.  The error is happening on a few different pages.  The common part is that every time it's around code that does this:

Num(_query{"program_id"})

The code is always casting a query param with an ID in it to a number.  It's either being used in a query or assigning to a correctly typed variable.

Thanks
Justin
_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Errors that shouldn't be

Justin Will
In reply to this post by Justin Will
So I went through the pages that were throwing errors and changed my code from:

_query{"param"}

To

get query param("param")

and my errors have seemed to have stopped.  I guess I am not certain why, but I am happy that the errors are now gone.

Thanks
Justin

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Errors that shouldn't be

Aparajita Fishman
Very strange indeed. I seem to remember this happening to someone long ago. I'll take a look at my code and see if I can figure out any reason why this is happening.


> On Nov 21, 2015, at 8:00 PM, Justin Will <[hidden email]> wrote:
>
> So I went through the pages that were throwing errors and changed my code from:
>
> _query{"param"}
>
> To
>
> get query param("param")
>
> and my errors have seemed to have stopped.  I guess I am not certain why, but I am happy that the errors are now gone.

Regards,

  Aparajita


_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Errors that shouldn't be

Richard Carpenter-2
This happened to me when I accidentally sent in two query parameters with the same name.
________________________________________
From: [hidden email] <[hidden email]> on behalf of Aparajita Fishman <[hidden email]>
Sent: Sunday, November 22, 2015 11:44 PM
To: Active4D Developer Discussion List
Subject: Re: [Active4d-dev] Errors that shouldn't be

Very strange indeed. I seem to remember this happening to someone long ago. I'll take a look at my code and see if I can figure out any reason why this is happening.


> On Nov 21, 2015, at 8:00 PM, Justin Will <[hidden email]> wrote:
>
> So I went through the pages that were throwing errors and changed my code from:
>
> _query{"param"}
>
> To
>
> get query param("param")
>
> and my errors have seemed to have stopped.  I guess I am not certain why, but I am happy that the errors are now gone.

Regards,

  Aparajita


_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: Errors that shouldn't be

Aparajita Fishman
By jove, I think you've got it! Because sending multiple query parameters with the same name creates an array, and here's what my docs say about 'get query param':

***
If the item value is an array of multiple choices, the first multiple-choice value is returned. Note that this behavior is different than using the syntax:

_query{"multiple_choice_value"}  // returns longint

When using the collection indexing syntax, a reference to an array with no index returns the array itself.
***

And it turns out that Active4D's 'num' command chokes when given an array. In the case of accidental multiple query params, that isn't much worse than always getting zero back from '_query{"id"}' and not knowing why.

Thank you Richard!


> On Nov 23, 2015, at 6:37 AM, Richard Carpenter <[hidden email]> wrote:
>
> This happened to me when I accidentally sent in two query parameters with the same name.
> ________________________________________
> From: [hidden email] <[hidden email]> on behalf of Aparajita Fishman <[hidden email]>
> Sent: Sunday, November 22, 2015 11:44 PM
> To: Active4D Developer Discussion List
> Subject: Re: [Active4d-dev] Errors that shouldn't be
>
> Very strange indeed. I seem to remember this happening to someone long ago. I'll take a look at my code and see if I can figure out any reason why this is happening.
>
>
>> On Nov 21, 2015, at 8:00 PM, Justin Will <[hidden email]> wrote:
>>
>> So I went through the pages that were throwing errors and changed my code from:
>>
>> _query{"param"}
>>
>> To
>>
>> get query param("param")
>>
>> and my errors have seemed to have stopped.  I guess I am not certain why, but I am happy that the errors are now gone.
>
> Regards,
>
>  Aparajita

Regards,

  Aparajita


_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/