LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
ale870
- Posts: 250
- Joined: Tue Apr 22, 2008 9:17 am
-
Contact:
Post
by ale870 » Thu Oct 23, 2014 9:26 am
Hello,
I'm using try/catch to detect some errors. This structure return some error numbers but I cannot "decode" them.
Please can you give me a reference to read them?
For example (trivial example):
Code: Select all
try
get 5/0
catch err
answer err
end try
I get:
379,337,6
223,337,1
So... ???
-
Klaus
- Posts: 13820
- Joined: Sat Apr 08, 2006 8:41 am
- Location: Germany
-
Contact:
Post
by Klaus » Thu Oct 23, 2014 11:48 am
Hi ale870,
what you see are the hints rom the ERRORDIALOG, check the dictionary for more info.
...
The executionError parameter is a standard LiveCode error backtrace in the form:
<error-code>,<line-number>,<column-number>[,<hint>]
...
Best
Klaus
-
ale870
- Posts: 250
- Joined: Tue Apr 22, 2008 9:17 am
-
Contact:
Post
by ale870 » Thu Oct 23, 2014 12:35 pm
Klaus wrote:Hi ale870,
what you see are the hints rom the ERRORDIALOG, check the dictionary for more info.
...
The executionError parameter is a standard LiveCode error backtrace in the form:
<error-code>,<line-number>,<column-number>[,<hint>]
...
Best
Klaus
Great thank you!
But the problem is not yet solved since, reading the documentation and making tests, error codes are stored inside
revErrorDisplay, and that stack is available only when using the IDE (so I cannot get info during runtime
It is crazy that I cannot include that stack while I distribute my application.
Any workaround?
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki
-
Neurox66
- Livecode Opensource Backer
- Posts: 120
- Joined: Tue May 22, 2012 1:57 pm
- Location: Vicenza (Italy)
-
Contact:
Post
by Neurox66 » Thu Oct 23, 2014 1:10 pm
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
-
ale870
- Posts: 250
- Joined: Tue Apr 22, 2008 9:17 am
-
Contact:
Post
by ale870 » Thu Oct 23, 2014 3:06 pm
Thank you! That RevOnline Error Lookup is amazing! I can extract and embed those error codes inside my app!
Thank you again, I solved my problem!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki
-
dbeugeling
- Posts: 12
- Joined: Thu Feb 12, 2015 12:22 pm
Post
by dbeugeling » Fri May 26, 2023 12:43 pm
Hi,
The link is no longer valid.
Is there an updated one?
Thanks
Dirk
-
Klaus
- Posts: 13820
- Joined: Sat Apr 08, 2006 8:41 am
- Location: Germany
-
Contact:
Post
by Klaus » Fri May 26, 2023 1:44 pm
Dag Dirk,
here a little stack from Jacque Gay, which does it locally.
Best
Klaus
-
Attachments
-
- Error Lookup.livecode.zip
- (17.02 KiB) Downloaded 62 times
-
FourthWorld
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
-
Contact:
Post
by FourthWorld » Fri May 26, 2023 2:52 pm
It seems weird to me that there isn't a documented function for looking up the error string from the error code number.
-
jacque
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
-
Contact:
Post
by jacque » Fri May 26, 2023 6:02 pm
FourthWorld wrote: ↑Fri May 26, 2023 2:52 pm
It seems weird to me that there isn't a documented function for looking up the error string from the error code number.
It's in the entry for errorDialog in the dictionary.
@klaus Richard and I co-wrote the error lookup stack. It's also available in the LC user examples online.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
FourthWorld
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
-
Contact:
Post
by FourthWorld » Fri May 26, 2023 7:00 pm
jacque wrote: ↑Fri May 26, 2023 6:02 pm
FourthWorld wrote: ↑Fri May 26, 2023 2:52 pm
It seems weird to me that there isn't a documented function for looking up the error string from the error code number.
It's in the entry for errorDialog in the dictionary.
Thank you. I'd forgotten about the scriptExecutionErrors.
That these sorts of questions keep coming up several times a year suggests a rethink on error handling may be helpful. ErrorDialog is used in many contexts unrelated to even potentially showing a dialog window, and there are opportunities to streamline decoding the error data, as well as making error handling more consistent than the current collection of sometimes rules (sometimes we check errorDialog, sometimes we need to use sysError, sometimes we check the result, sometimes we need to structure our code specifically for error handling using try/catch...).
-
stam
- Posts: 2679
- Joined: Sun Jun 04, 2006 9:39 pm
- Location: London, UK
Post
by stam » Fri May 26, 2023 7:56 pm
I've just noticed that scriptExecutionErrors returns empty in standalones, further reducing it's value...
You'd need to duplicate scriptExecutionErrors in your stack if you wanted to provide proper feedback on errors in a standalone. Not any degree of difficult, but why the extra step?
-
jacque
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
-
Contact:
Post
by jacque » Fri May 26, 2023 8:01 pm
stam wrote: ↑Fri May 26, 2023 7:56 pm
I've just noticed that
scriptExecutionErrors returns empty in standalones, further reducing it's value...
You'd need to duplicate
scriptExecutionErrors in your stack if you wanted to provide proper feedback on errors in a standalone. Not any degree of difficult, but why the extra step?
Maybe because there is no debugger included in standalones.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
stam
- Posts: 2679
- Joined: Sun Jun 04, 2006 9:39 pm
- Location: London, UK
Post
by stam » Fri May 26, 2023 8:07 pm
jacque wrote: ↑Fri May 26, 2023 8:01 pm
stam wrote: ↑Fri May 26, 2023 7:56 pm
I've just noticed that
scriptExecutionErrors returns empty in standalones, further reducing it's value...
You'd need to duplicate
scriptExecutionErrors in your stack if you wanted to provide proper feedback on errors in a standalone. Not any degree of difficult, but why the extra step?
Maybe because there is no debugger included in standalones.
Do you need a debugger to get the error codes? I ask because the standalone settings have a 'bug reports' section which I presume relates to LC error codes being generated. How else would this be triggered? And I haven't checked but had assumed the error numbers returned would do so in standalones as well, or is this also not the case?
(Also - Richard elegantly showed a debugger that can be included in a standalone...)
-
jacque
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
-
Contact:
Post
by jacque » Fri May 26, 2023 8:17 pm
The scriptExecutionErrors seems to be an IDE thing. If you want to catch all errors, not just the ones that LC reports in standalones (i.e., catch silent errors) you can use an errorDialog handler. That's what I usually do.
Code: Select all
on errorDialog pErr
answer "Error:" && the params &cr& pErr
end errorDialog
Edit: Error info is generated in a standalone but unless they are fatal, users won't see a dialog. The above catches all of them.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
stam
- Posts: 2679
- Joined: Sun Jun 04, 2006 9:39 pm
- Location: London, UK
Post
by stam » Fri May 26, 2023 8:22 pm
jacque wrote: ↑Fri May 26, 2023 8:17 pm
The scriptExecutionErrors seems to be an IDE thing. If you want to catch all errors, not just the ones that LC reports in standalones (i.e., catch silent errors) you can use an errorDialog handler. That's what I usually do.
Errrrmmm... now I'm confused.
Dictionary on scriptExecutionErrors wrote:Reports a list of all possible LiveCode script execution errors.
It's just a return-delimited list of LC errors, whose line number corresponds to the error number. In itself it catches nothing, it's just a a verbose dictionary. So why should it not be in standalones
Also - when the time time I included this in a standalone for distribution, it kept firing with either numbers or nothing and was always non-fatal - users just dismissed it and I just shrugged my shoulders