popcode icon indicating copy to clipboard operation
popcode copied to clipboard

All runtime errors should appear in the console

Open outoftime opened this issue 8 years ago • 6 comments

If project code throws a runtime error, the (human-friendly) error message should appear in the console, just as it does in the bowser JavaScript console.

Combined with #1262 this might make the existing mechanism for displaying runtime errors obsolete? Although I do like how in-your-face the existing functionality is. We could certainly keep both.

outoftime avatar Dec 09 '17 18:12 outoftime

Hey @outoftime, I'm ready to get started on this. I just want to verify that I'm clear on the issue.

  1. This is the console, where we want the human-friendly error message to appear. console
  2. This is the "browser JavaScript console," currently displaying an error message. We want this same message to appear in the console mentioned above. browser javascript console

Please let me know if I'm missing anything, or am not quite clear. Thanks!

omardeleo avatar Nov 08 '18 21:11 omardeleo

@omardeleo you’re half right : )

The concern here is runtime errors—i.e. errors that Popcode can’t detect just by analyzing the code. Rather, these errors happen when the code actually runs.

Here’s an example of the current behavior:

image

However, if you open the console, you’ll notice that the error does not appear there:

image

This is inconsistent with the way a “real” JavaScript console (e.g. the Chrome console) behaves; one would expect to see all runtime errors in that context.

ALSO, I realized that there is actually prior art on this issue: https://github.com/popcodeorg/popcode/pull/1528

It looks like that PR has been dormant for a couple months so you should feel free to pick it up, or start a fresh one borrowing whatever is useful, depending on your inclination.

outoftime avatar Nov 09 '18 12:11 outoftime

Oh and here’s a snapshot of the code I screengrabbed above.

outoftime avatar Nov 09 '18 12:11 outoftime

Cool, thanks for the clarification! I'll check out the prior art next.

omardeleo avatar Nov 09 '18 14:11 omardeleo

Lol, yah I petered out on the original effort. I think I have some time before school gets busy again and I was about to try and make a last push to incorporate @outoftime's ideas to move the normalizing of the error in the reducer and passing raw error from both console and runtime actions. Did you already take care of this @omardeleo ? I'm happy to move on and forget this attempt ever happened lol.

ryanquincypaul avatar May 08 '19 16:05 ryanquincypaul

Hey @ryanquincypaul, thanks for checking in! I've got a handle on this, so feel free to pick up a new issue if you'd like.

omardeleo avatar May 08 '19 17:05 omardeleo