Misleading error message if snippet returns null

20 views
Skip to first unread message

wei...@react.uni-saarland.de

unread,
May 18, 2016, 3:10:42 AM5/18/16
to Lift
Hello everybody,

lately I’ve encountered some odd behavior of Lift. Namely, if a snippet returns null, the following error message appears in development mode: … While technically correct (I think), in my opinion, that error message is misleading, since the method was indeed found, but returned null instead of some actual NodeSeq. Would it be possible to change the error message in future versions to reflect that? I first encountered the problem with Lift 2.5.1, but the problem persists in Lift 3.0-RC3.

I’ve attached a sample project that exhibits the behavior. Just type `sbt ~container:start` and navigate to 127.0.0.1:8080 to see the error message. The snippet is implemented in `src/main/scala/code/snippet/HelloWorld.scala`.

Should I open a ticket for this, or is this intended behavior?

Alex
project.tar

Diego Medina

unread,
May 18, 2016, 3:15:53 AM5/18/16
to Lift
is the error  really 

...

or did you forget to paste the error?

also, while it may be the same for you, we prefer if you post sample projects on github following these instructions: (they could be a bit outdated, but mainly, post them to github which is easier for us to work with)



Thanks





--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Diego Medina
Lift/Scala Consultant
di...@fmpwizard.com
http://blog.fmpwizard.com/

wei...@react.uni-saarland.de

unread,
May 18, 2016, 3:30:08 AM5/18/16
to Lift
Darn, prepared the message while being offline and didn't proofread before I sent it. Sorry about that, I will update it shortly with the correct error message and a github link.

Alex

wei...@react.uni-saarland.de

unread,
May 18, 2016, 3:57:59 AM5/18/16
to Lift
Ok, here we go again. The actual error is as follows:

Error processing snippet: mysnippet.method
Reason: Method Not Found
There are possible matching methods ( method ), but none has the required signature:
def
                                  method
                                 
(in: NodeSeq): NodeSeq

XML causing this error:
          <lift:mysnippet.method xmlns="http://www.w3.org/1999/xhtml"> 
   
</lift:mysnippet.method>

I've committed the project to https://github.com/aweinert/liftweb-null-snippet. The readme contains the steps necessary for reproduction.

Alex


On Wednesday, May 18, 2016 at 9:15:53 AM UTC+2, fmpwizard wrote:

Antonio Salazar Cardozo

unread,
May 18, 2016, 10:52:52 AM5/18/16
to Lift
Yes, 100% think we should improve this. Can you file an issue? Those snippet errors
have a lot of interesting corner cases where they aren't quite as informative as they could
be, and improving them is something I've been wanting to do for a while :)
Thanks,
Antonio

wei...@react.uni-saarland.de

unread,
May 19, 2016, 3:02:35 AM5/19/16
to Lift
Done, I've posted an issue at https://github.com/lift/framework/issues/1799

Thanks for your response,
Alex
Reply all
Reply to author
Forward
0 new messages