maehw / WebPBrick

Web-based IDE for programming the LEGO Mindstorms RCX using NQC with modern technologies
https://www.webpbrick.com
GNU General Public License v3.0
16 stars 4 forks source link

Expose RuntimeErrors to the user, e.g. integer divide by zero #5

Closed maehw closed 4 months ago

maehw commented 4 months ago

Is your feature request related to a problem? Please describe. User is unable to see why their code does not compile even though there's an error message covered under the hood.

I've discovered this by having a division by zero in my NQC code (more or less intentional). The minimal example to reproduce this in WebPBrick v0.1.0:

int x;

task main() {
  x = 1 / 0;
}

The web development console logs:

Uncaught (in promise) RuntimeError: integer divide by zero
    createWebNqc https://webpbrick.com/nqc/webnqc/nqc.js:711
    callMain https://webpbrick.com/nqc/webnqc/nqc.js:4951
    clickConvert https://webpbrick.com/ide/nqcWrapper.js:179

Describe the solution you'd like Uncover the hidden error message and "expose" it to the user by displaying it in the usual log area.

Describe alternatives you've considered Let the advance user find this out theirselves... (not a real alternative from my POV).

Additional context N/A