-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Hi!
I haven't actively used the shard since I finished implementing my config file reader a few months ago, but I recently started a new project so I had to write a new one :P
It still works very well 🥳 Thank you!
The issue I ran into, however, was that migrating config files is impossible, because missing nodes will throw an error:
require "kdl"
class Missing
include ::KDL::Serializable
@[KDL::Child(name: "Something", unwrap: "argument")]
property something : String = "hello!"
end
kdl = KDL.load_file "test.kdl"
missing = Missing.from_kdl kdl
pp missingTrying to run this on an existing, but empty test.kdl file will results in the following error:
Unhandled exception: Element not found (Enumerable::NotFoundError)
from lib/kdl/src/kdl/node.cr:70:28 in 'child'
from lib/kdl/src/kdl/node.cr:98:7 in 'arg'
from lib/kdl/src/kdl/serializable.cr:86:7 in 'initialize:__node_for_kdl_serializable'
from test.cr:4:3 in 'new_from_kdl_node'
from test.cr:4:3 in 'new'
from test.cr:4:3 in 'from_kdl'
from test.cr:11:1 in '__crystal_main'Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working