Incorrect Readable Error-Message when calling Function >10 Chars
See original GitHub issueThe following Code in the Template:
{% set thumbnail_url = env.helper.getImageUrl('foo', first_image.url, 'large' ) %}
compiles to sth. like
var t_18;
t_18 =
(lineno = 11, colno = 45,
runtime.callWrap(
runtime.memberLookup((
runtime.memberLookup((
runtime.contextOrFrameLookup(context, frame, "env")
),
"helper"
)
),
"getImageUrl"
)
, "env[\"helper\"][\"getImageUr\"]", context,
[
"foo"
,
runtime.memberLookup((
runtime.contextOrFrameLookup(context, frame, "first_image")
),
"url"
)
,
"large"
])
)
If the Call for whatever reasons fail, the printed reable error message will be something like:
Template render error: (/home/peter/AAA-Misc/marcellammon/templates/galleries-index.html) [Line 11, Column 45]
Error: Unable to call `env["helper"]["getImageUr"]`, which is undefined or falsey
which obviously points users into the wrong direction. The Reason is that compileFunCall
uses _getNodeName
to generate the function’s name, which shortens Literals to 10 Chars without any hint.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
how to find, "invalid character ',' looking for beginning of value ...
First, as has been commented, are you sure you can't use the go/build package directly rather than running go list ?
Read more >9 Error messages | The tidyverse style guide
9 Error messages. An error message should start with a general statement of the problem then give a concise description of what went...
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >Modern C++ best practices for exceptions and error handling
An exception forces calling code to recognize an error condition and handle it. Unhandled exceptions stop program execution. An exception jumps ...
Read more >Functions - Advanced R. - Hadley Wickham
Functions. Functions are a fundamental building block of R: to master many of the more advanced techniques in this book, you need a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Wow, thank you @carljm! If you really found help in the little I’ve done, why would I stop helping… I will restrict myself to issues of course.
I knew this existed, and looked for it awhile yesterday but couldn’t find it. Thanks @ricordisamoa! If it’s ok with you, I’m adding you as a project collaborator so you can take care of things like this yourself (please submit code changes as PRs and get them reviewed, don’t just commit directly).