question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect Readable Error-Message when calling Function >10 Chars

See original GitHub issue

The 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:closed
  • Created 8 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ricordisamoacommented, Mar 18, 2016

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.

0reactions
carljmcommented, Mar 18, 2016

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found