Help with Error Message

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
interactbooks
Posts: 65
Joined: Thu Oct 07, 2010 4:47 pm

Help with Error Message

Post by interactbooks » Mon Jan 10, 2011 8:52 am

I am using the S3 library, in my development environment everything looks fine, however in standalone mode I receive an error which I have enclosed. My question is how do I go back making heads or tails out of this error. I'm not even sure how to proceed since there does not seem to be any useful information being provided with this error.
Attachments
Error.png
Error.png (52.01 KiB) Viewed 7232 times

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: Help with Error Message

Post by Janschenkel » Mon Jan 10, 2011 12:08 pm

The revMacFromUnixPath function is part of the 'revCommon' backscript. You'll need to make sure it's included in the standalone.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

interactbooks
Posts: 65
Joined: Thu Oct 07, 2010 4:47 pm

Re: Help with Error Message

Post by interactbooks » Mon Jan 10, 2011 3:44 pm

Jan,

Isn't the RevCommon already included automatically when I build the stack? I don't see a choice for this library in the StandAlone settings. Also, this specific function seems to work very intermittently, I can't really figure out a pattern when it works and when it does not. Could you let me know how to ensure that revCommon is included? In general how do I make sense of the errors that are returned by LiveCode, this is probably my greatest point of confusion, otherwise I love the environment.

Thanks so much,

Ezra

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Help with Error Message

Post by mwieder » Mon Jan 10, 2011 11:02 pm

If you were running PowerDebug you could open the messagebox and type

Code: Select all

put ExplainError(219)
and see "Function: error in function handler"

I think Mark Schonwille has something on his website that does something similar. I don't have the url handy, but I'm sure he'll post something here shortly.

Or you could go the long way around and type in the messagebox

Code: Select all

put line x of the cErrorsList of stack "revErrorDisplay"
where x is the first item of one of the lines in the error listing.

kray
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 56
Joined: Sat Apr 08, 2006 5:28 pm
Contact:

Re: Help with Error Message

Post by kray » Tue Jan 11, 2011 3:15 pm

interactbooks wrote:I am using the S3 library, in my development environment everything looks fine, however in standalone mode I receive an error which I have enclosed. My question is how do I go back making heads or tails out of this error. I'm not even sure how to proceed since there does not seem to be any useful information being provided with this error.
Basically, the errors returned shows you the 'path' to the actual error that was generated. There's 3 or 4 items on each line, in this format:
  • <errorCode>,<errorLine>,<errorChar>[,<errorObjectOrHandler>]
The errorCode you need to look up in stack "revErrorDisplay" (as Mark pointed out) to find the English translation of what the error code means. The errorLine and errorChar are the line number and character on that line in the script of the object where the problem was encountered. The errorObjectOrHandler is either the LiveCode object that owned the script that generated the error (these would be the lines that start with "353,0,0") or the handler name in the script that contained the line that errored out.

The error lines are to be read in a "bottom-up" fashion, where the last line is the object where the error originated (effectively the object that received the first event that ended up triggering the error), and the first line is the handler that actually generated the error.

So in the screenshot you provided the error lines translate to:

Code: Select all

Function: error in function handler / Line: 1832 / Char: 9 / Handler: revMacFromUnixPath
Operators &: error in left operand / Line: 1832 / Char: 35
put: error in expression / Line: 1832 / Char: 1
Object: stack "/Users/Rachael/Downloads/InteractBuilder.app/Contents/MacOS/lib3.rev"
Function: error in function handler / Line: 279 / Char: 35
Function: error in function handler / Line: 279 / Char: 35
Operators and: error in right operand/ Line: 279 / Char: 23
if-then: error in condition expression / Line: 279 / Char: 1
Handler: error in statement / Line: 279 / Char: 1 / Handler: s3.uploadFile
Object: stack "/Users/Rachael/Downloads/InteractBuilder.app/Contents/MacOS/lib3.rev"
Handler: can't find handler / Line: 55 / Char: 1 / Handler: s3.uploadFile
Handler: error in statement / Line: 55 / Char: 1 / Handler: uploadFileToS3
Object: image id 21405 of group id 19534 of card id 1002 of stack "/Users/Rachael/Downloads/InteractBuilder.app/Contents/MacOS/InteractBuilder"
Handler: can't find handler / Line: 15 / Char: 1 / Handler: UploadFileToS3
if-then: error in statement / Line: 14 / Char: 1
:
(etc.)
Not all of the lines were displayed in the answer dialog, so I can't see the originating object, but the key line here is actually the second one:

Code: Select all

Operators &: error in left operand / Line: 1832 / Char: 35
It sounds like you're trying to use "&" in a bad way when calling revMacFromUnixPath in that script. I'd start there...

Ken
Ken Ray
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Help with Error Message

Post by mwieder » Tue Jan 11, 2011 6:34 pm

...and I completely missed the fact that this error is being generated in a standalone app. Since you're using the lib3.rev library and presumably haven't changed its code, it looks like you're passing a bad parameter to the revMacFromUnix function. And the calling chain seems to be

uploadFileToS3
--> s3.uploadFile
----> isPackage
------> revMacFromUnix

The "can't find handler" errors in uploadFileToS3 are suspicious. If this works in the IDE but not in a standalone, then this possibly may be something with the defaultFolder.

interactbooks
Posts: 65
Joined: Thu Oct 07, 2010 4:47 pm

Re: Help with Error Message

Post by interactbooks » Tue Jan 11, 2011 10:16 pm

Ken and Mark,

Thank you for all your help. This really helps clarify in my mind how to handle error in LiveCode. I really am so thrilled to be involved in such a vibrant and helping community!!!! This just really solidifies in my mind that I chose the right platform.

Thank you again,

Ezra

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Help with Error Message

Post by Mark » Sat Jan 22, 2011 3:19 am

Hi,

A quick way to look up error codes is http://runrev.info/error.html

Best,

(another) Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply