edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] Error Object
Date: Fri, 19 Jan 2018 21:51:54 +0100	[thread overview]
Message-ID: <20180119205154.GA7850@nautica> (raw)
In-Reply-To: <20180019150815.eklhad@comcast.net>

Hi Karl, thanks for this mail,

Karl Dahlke wrote on Fri, Jan 19, 2018:
> Re: x.foobar, the base value is unfortunately not available after
> error creation. Both expressions like 'v = x.foobar' and 'v =
> x.foobar()' do have access to 'x' when the internal call site creates
> and throws the error. So it would be technically possible to include
> the base value as a property of the error object before it gets
> thrown. That would be an entirely custom feature though, and would
> capture the base value (maybe keeping it live for longer than
> expected). One option would be to pass in the base value into
> Duktape.errCreate using some form of "additional parameters" object,
> e.g. equivalent of:

The problem I have isn't that 'x.foobar is undefined' but the error is
often:
TypeError: undefined not callable (property 'something' of [object Object]) 

That does not tell you the name of the variable to inspect, so you have
to go back to code.


> When using the debugger, it's possible to pause on uncaught error
> (DUK_USE_DEBUGGER_PAUSE_UNCAUGHT), at which point you can inspect 'x'
> as a local variable. The internal implementation is capable of pausing
> also on caught errors, but the debugger protocol doesn't expose this yet.

I have that in my branch, but do not offer the ability to do much from
the pause at this point -- this shouldn't be too hard to extend though
if we can catch what 'x' is.

What I'd like to make work is:
 - plug debugger
 - run with demin
 - on error give a prompt
 - from prompt give possibility to 'list' lines from the script around
current line (kind of like gdb), to eval variables like jdb but through
the debugger eval command

Just that should help greatly; I'm still missing the last part but
shouldn't be too difficult at this point...

-- 
Dominique

  reply	other threads:[~2018-01-19 20:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 20:08 Karl Dahlke
2018-01-19 20:51 ` Dominique Martinet [this message]
2018-01-25 10:48 ` [Edbrowse-dev] defaultView / cloning onevent$$array Kevin Carhart
2018-01-25 14:07   ` Karl Dahlke
2018-01-25 23:07     ` Kevin Carhart
2018-01-26  2:58       ` Karl Dahlke
2018-01-26  3:50         ` [Edbrowse-dev] nasa / prepending "on" to events Kevin Carhart
2018-01-26  4:59           ` Karl Dahlke
2018-01-26  5:51             ` Kevin Carhart
2018-01-26  6:43               ` Karl Dahlke
2018-01-26  8:10                 ` Kevin Carhart
2018-01-26  8:21                   ` Kevin Carhart
2018-01-26  9:08                     ` Karl Dahlke
2018-01-26 10:38                       ` Kevin Carhart
2018-01-26 14:32                         ` Karl Dahlke
2018-01-26 19:13                           ` Geoff McLane
2018-01-26 19:28                             ` Karl Dahlke
2018-01-27  3:52                           ` Kevin Carhart
2018-01-27 18:52                             ` Geoff McLane
2018-01-27 21:10                               ` Karl Dahlke
2018-01-28  3:12                               ` Karl Dahlke
2018-01-28 19:19                                 ` Geoff McLane
2018-01-28 21:35                                   ` Karl Dahlke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180119205154.GA7850@nautica \
    --to=asmadeus@codewreck.org \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).