-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] compiler: improve error message when failing to compile template
Previously, when a template failed to compile because of a syntax error (typically because we don't do any syntax checking when compiling expression, allowing invalid expressions to be transpiled successfully), the error reporting was very minimal: you would only get the error message itself (eg: "Unexpected token") with the stack information of the error pointing to the call to `new Function` in owl, which is not very useful. This commit catches the compilation error and completes it with information about the template name when available, and also adds the generated code to the error message, allowing the user to just copy/paste it in their web console or code editor to get a more precise location for the error.
- Loading branch information
1 parent
7bc9d34
commit 9d99f89
Showing
5 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters