xodio / xod

XOD IDE
https://xod.io
GNU Affero General Public License v3.0
888 stars 119 forks source link

Transpiler fails silently on C++ syntax error in patch, must restart app to continue #2135

Open crashkopf opened 8 months ago

crashkopf commented 8 months ago

Environment

Steps to reproduce

faulty.zip Open the attached project, open the "deploy-me" patch. Try to deploy the project.

Expected behavior

An error message should appear in the compiler log.

Actual behavior

Depending on how you try to deploy, you might get no error at all. If you were trying to upload to an Arduino, the upload dialog now has the message "Another deployment job is in progress", and the Upload button is inactive. If you try to simulate you get a red error pop-up that ends with the message, "The error has no formatter, which is a bug. Report the issue to XOD developers."

Console output

The relevant portion of the error output is: Uncaught Error: Syntax error at line X col Y: } ^ Unexpected rParen token: "}"."

How to fix

Sounds like the parser exception-handling code in the transpiler needs some love, but also, the reason for the syntax error in the patch is the automatic addition of the matching brace by the code editor, a feature which doesn't seem to have an off switch.