Add dynamic data when sending standalone bug report by mail?

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

Post Reply
Zax
Posts: 486
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

Add dynamic data when sending standalone bug report by mail?

Post by Zax » Fri Sep 09, 2022 3:29 pm

Hello,

Is there a way to dynamically add some infos like the platform - or other data get by script - sent by email when a standalone crashes and the user send a report with LC 9.6.8?
Actually, the only dynamic data received is the LC error message and, of course, the optional message added by the user.

stam
Posts: 2741
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Add dynamic data when sending standalone bug report by mail?

Post by stam » Fri Sep 09, 2022 4:53 pm

I'd really like to know that as well - if you do find out please do post it here...
S.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Add dynamic data when sending standalone bug report by mail?

Post by FourthWorld » Fri Sep 09, 2022 4:59 pm

I made my own error reporting stack that looks and behaves exactly as I like. Trap the errorDialog message to handle errors however you like.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 2741
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Add dynamic data when sending standalone bug report by mail?

Post by stam » Fri Sep 09, 2022 6:28 pm

Thanks Richard, that's useful!

I imagine this is one of those generalisable tasks that can easily be shared... I don't suppose anyone knows if some kind soul has released a stack like this?

Creating from scratch is fine, but i keep getting side-tracked from my main projects doing mini side-projects like this ;)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9738
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Add dynamic data when sending standalone bug report by mail?

Post by dunbarx » Fri Sep 09, 2022 6:34 pm

Stam.
but i keep getting side-tracked from my main projects doing mini side-projects like this
I live for those.

Craig

stam
Posts: 2741
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Add dynamic data when sending standalone bug report by mail?

Post by stam » Fri Sep 09, 2022 6:46 pm

Craig,
Don't necessarily disagree and neither to I have developer deadlines etc. But my free time is extremely limited due to (non-programming) work and getting anything done takes months instead of days with all the little detours that crop up.

The detours are fun and educational, but it's getting to the point that it's just eating up my diminishing free time :-/
I'l take a shortcut if i can ;)

Zax
Posts: 486
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

Re: Add dynamic data when sending standalone bug report by mail?

Post by Zax » Sat Sep 10, 2022 6:50 am

FourthWorld wrote:
Fri Sep 09, 2022 4:59 pm
I made my own error reporting stack that looks and behaves exactly as I like. Trap the errorDialog message to handle errors however you like.
Radical and effective solution, Richard.
Thank you.

Does it work with built-in revmail, or do you prefer to use a custom mail engine mais tsNet?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Add dynamic data when sending standalone bug report by mail?

Post by FourthWorld » Sat Sep 10, 2022 4:45 pm

Zax wrote:
Sat Sep 10, 2022 6:50 am
FourthWorld wrote:
Fri Sep 09, 2022 4:59 pm
I made my own error reporting stack that looks and behaves exactly as I like. Trap the errorDialog message to handle errors however you like.
Radical and effective solution, Richard.
Thank you.

Does it work with built-in revmail, or do you prefer to use a custom mail engine mais tsNet?
I use a custom equivalent of revMail ("launch URL" with the "mailto:" service specifier), for two reasons:

1. As a user I like having my email in one place, and imagine at least some of my customers do too.

2. When sending info about a user's system I prefer to err on the side of transparency, allowing the user to see exactly what's being sent. Of course they won't understand all of it, but at least they can see I'm not including any personal info, file paths to personal files, or anything else that might compromise their privacy.

LC makes it easy to make dialog windows, and the errordialog message was created for error reporting, so it never struck me as unusual to use the tools provided to deliver the UX I'm looking for. Error handling just struck me as the same sort of thing as making an About box or anything other part of the app.

LC's option for this came along relatively late for me, and while I've used it in a few quickie things the absence of executionContexts (how does one debug without knowing the calling chain?) and system info (platform, version, screen size, disk space, other basics) made it a nonstarter for me.

I'm updating mine for an app I'm upgrading. It's self-contained so "start using" is all that's needed to let it do it's thing. Recipient address is currently a custom prop, but now that I have some clients where we route those to automated mail handling I'll add an init message to set recipient and possibly other details. When I get that done I can share it is it's useful.

But I'm not sure how many would use it. I see a great many messages in our community with raw error info provided, suggesting relatively few are even using LC's error dialog.

One of the reasons GBs of tooling on my HD haven't yet been shared is justifying the time for documentation and more thorough error checking. Like Steven McConnell says in "Code Complete":
The difference between a tool and a product is that with a tool it need only be necessary to use it correctly, but with a product it should be impossible to use it incorrectly.
I love LC but the audience is small. Donations for things like my devolution toolkit are much appreciated and have covered a couple of dinners out, but haven't yet been enough to justify time away from client work to integrate some of the other tooling floating around my drives like project metrics (static analysis for identifying complexity using the McCabe Index algo adapted for xTalk characteristics, global var and general calling chain patterns, etc.), versioning (diff and merge for binary stack files), and template stacks (like error handing, About, list picker, basic dialog template, and other generic essentials).

But on the other hand, one upside to a small audience is that expectations for completeness are lower. :) So I'll see if I can get that error dialog sharable when I can get back to it soon.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 2741
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Add dynamic data when sending standalone bug report by mail?

Post by stam » Sat Sep 10, 2022 7:14 pm

Thanks Richard, i had no idea executionContexts even existed - the entry in the dictionary was very helpful.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Add dynamic data when sending standalone bug report by mail?

Post by FourthWorld » Sun Sep 11, 2022 12:00 am

stam wrote:
Sat Sep 10, 2022 7:14 pm
Thanks Richard, i had no idea executionContexts even existed - the entry in the dictionary was very helpful.
It's a godsend for attempting to understand vague recipes from end-users. The executionContexts has saved me many thousands of $ in what would have been lost time trying to track down issues without it.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 136
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: Add dynamic data when sending standalone bug report by mail?

Post by bobcole » Sun Sep 11, 2022 1:13 am

by FourthWorld » Fri Sep 09, 2022 10:59 am
... Trap the errorDialog message to handle errors however you like.
Here is my attempt.
(Note that limited HTML formatting is permissible in the error dialog)
Screen Shot 2022-09-10 at 6.59.52 PM.png
Put the following script into a button and run it.

Code: Select all

on mouseUp pButtonNumber
   --force an error:
   put "abc" into field "no such field" --message box
end mouseUp

on errorDialog pExecutionError, pParseError
   put item 2 of line 1 of pExecutionError into tErrorLine
   put line (item 1 of line 1 of pExecutionError) of the scriptExecutionErrors into tErrorType
   put "<p><u>" before tErrorType
   put "</u></p>" after tErrorType
   put "<p></p><p>the platform: <b>" & the platform & "</b></p>" & return into tDiagnostics
   put "<p>the machine: <b>" & the machine & "</b></p>" & return after tDiagnostics 
   put "<p>the systemVersion: <b>" & the systemVersion & "</b></p>" & return after tDiagnostics 
   put "<p>the processor: <b>" & the processor & "</b></p>" & return after tDiagnostics 
   put "<p>the stack file version: <b>" & the version & "</b></p>" & return after tDiagnostics 
   put "<p>the build number: <b>" & the buildNumber & "</b></p>" & return after tDiagnostics 
   put "<p>the environment: <b>" & the environment & "</b></p>" & return after tDiagnostics 
   put "file:///Users/robertcole/Desktop/BC%20head.jpg" into tSource
   put "<p><img src=tSource></p>" & return after tDiagnostics  
   answer "An <b>error</b> occurred on line: " & \
         tErrorLine & return \
         & tErrorType & return \
         & tDiagnostics
   put pExecutionError into message box
end errorDialog
I haven't tried to deal with executionContexts yet.
Bob

stam
Posts: 2741
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Add dynamic data when sending standalone bug report by mail?

Post by stam » Sun Sep 11, 2022 1:22 am

That looks pretty good Bob, thank you for sharing!

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 136
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: Add dynamic data when sending standalone bug report by mail?

Post by bobcole » Sun Sep 11, 2022 1:30 am

I forgot to mention that the Development -> Script Debug Mode
must be unchecked (no debugging) for the script to display the error dialog.
Bob

Zax
Posts: 486
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

Re: Add dynamic data when sending standalone bug report by mail?

Post by Zax » Sun Sep 11, 2022 1:22 pm

I made this error report stack.
It has to be a substack and its script inserted into front at startup.

It hasn't been heavily tested. It uses revMail command because I haven't been able to get URL mailto protocol to work.
Like Bob, I haven't tried to deal with executionContexts.
lcerr.jpg
It produces a mail like this:

Code: Select all

An error occurred with ' Beleaguered Castle'.

-------------------------- ERROR --------------------------
Handler: mouseup
Line: 2 --> goToCard
Control: button id 27021 of group id 26662 of card id 1058 of stack "/Users/PERSO/Dev/LiveCode/Beleaguered Castle/BeleagueredCastle 0.16.livecode"

----------------------- ENVIRONMENT -----------------------
Beleaguered Castle 

Release date: 
Engine: 9.6.8
Prefs file: 

Machine: MacBookPro8,3
Processor: x86_64
OS: MacOS
System version: 10.12.6

---------------------- USER COMMENTS ----------------------
I do nothing, I swear! 
NB:
- release date and Prefs file are specials data used in my libs.
- the email address can be provided by this stack's custom property the EmailAdress, or dynamically defined in this stack's script with errorDialog_getMailAddress function.
_ErrorReport.livecode.zip
(3.71 KiB) Downloaded 63 times

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”