I noticed a strange behavior of Props object: if you try to open some
property by name and it didn't exist, Props.get returns an Empty box
with no reasoning about the error.
But, if you add a simple error reason, things will become more logical
and logging starts to be better. For example, you will get this if you
open your box using `.openOrThrowException("")`:
Cause: net.liftweb.common.Failure$$anon$1: An Failure Box was opened.
Failure Message: could not load configuration property 'my.test'. The
justification for allowing the openOrThrowException was
[info] at net.liftweb.common.Failure.openOrThrowException(Box.scala:757)
[info] at net.liftweb.common.Failure.openOrThrowException(Box.scala:726)
...
I made a PR to fix things (as I think, at least)
https://github.com/vn971/framework/commit/7d91899c8957026b803aeeb3938ef5696b2d522c
Are there any additional thoughts/doubts? Lift contribution guidelines
ask to create an ML topic before PR. I also can cherry-pick this commit
onto any other branch (if needed).
Also, a separate question. Will you accept a PR that _deletes_ all
method bodies from abstract class "Box"? Currently, Box declares _and
implements_ lots of methods. Some of them are overridden by descendant
classes.
The problem with that approach is, as I see it, readability. Currently,
if you open a method on Box, you'll see something like:
`
def map[B](f: A => B): Box[B] = Empty
`
My first reaction to this is always "WTF do I need that stupid method
for?". Ok, after some time I of course remember about the descendants an
object-orientation of the code.. Still, I think having no implementation
in Box itself would be cleaner. Thoughts?
--
Vasya Novikov