adobe / adobe/htlengine

Improve error logs to help locating the issue in the HTL template

Open
#16 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
HTML
Stars
49
Forks
20
Avg merge
3h 46m
Merged PRs (30d)
1

Description

When there is something wrong in the htl template (like trying to access it.dummy.property which does not exist for exampl), the error log you get in the whole Petridish setup (and probably the same in the production setup) is something like:

```
[hlx] error: Error while rendering the resource: TypeError: Cannot convert undefined or null to object
at Function.keys ()
at lengthOf (../project-helix/modules/helix-helpx/.hlx/build/html.js:295:53)
at ../project-helix/modules/helix-helpx/.hlx/build/html.js:442:28
at Generator.next ()
at onFulfilled (../project-helix/modules/helix-helpx/node_modules/co/index.js:65:19)
at ../project-helix/modules/helix-helpx/node_modules/co/index.js:54:5
at new Promise ()
at co (../project-helix/modules/helix-helpx/node_modules/co/index.js:50:10)
at Runtime.run (../project-helix/modules/helix-helpx/node_modules/@adobe/htlengine/src/runtime/Runtime.js:47:12)
at run (../project-helix/modules/helix-helpx/.hlx/build/html.js:305:20)
at main (../project-helix/modules/helix-helpx/.hlx/build/html.js:482:12)
at getContextPath.catch.then (../project-helix/modules/helix-helpx/.hlx/build/html.js:240:19)
at
at process._tickCallback (internal/process/next_tick.js:182:7)
```

Which gives not hint on what is wrong in the template. It is crucial for development to output a meaningful error that helps locating the issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.