lift / lift/framework

Misleading error message if snippet returns null

Open
#1,799 4 comments 0 reactions 1 assignee View on GitHub

@Shadowfiend is already working on this.

Since May 20, 2016.

Dominant language
Scala
Stars
1.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

Summary

When a snippet returns null, the error message shown in the browser states that the corresponding method could not be found. This is somewhat misleading. I think it would be more informative if it were changed to something like snippet.method returned null. I have uploaded a small project showing this error at https://github.com/aweinert/liftweb-null-snippet.

What I did

$ git clone https://github.com/aweinert/liftweb-null-snippet
<...snip...>
$ cd liftweb-null-snippet
$ ./sbt
> container:start
<...snip...>

Then, open a browser and navigate to 127.0.0.1:8080

What happened

An error is displayed, as shown here: screenshot

What I expected to happen

An error should indeed be displayed, but I think the error message is somewhat misleading.
While it is probably technically correct, it should point to a null-pointer-issue rather than to a method resolution one.

Previous discussion

I have also posted this issue to the mailing list.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.