Closed MatthewHink closed 3 years ago
Happens on an untyped nil interface value such as below. The trick is going to be getting the key name in the error message. Line number may be best, but that is likely even more difficult. Probably simplest is to emit map key names as we traverse under debug logging (?)
- type: macAddressWide
handler: read_only_holding_register
data:
host: "10.193.12.210"
port: 502
timeout: 10s
failOnError: false
type: macaddresswide
# This is the problem here. This is an untyped nil interface value.
width:
context:
rack: r1
model: AC CPM
tags:
- 'vapor/rack:r1'
instances:
- info: LAN Mac Address
output: macAddressWide
data:
address: 5
Other ways:
Both are less prettier code-wise, but may be more effective as far as quickly pointing out the config error. The thing is that the error happens one stack frame down from good information to put in the error message. (recursion)
Hit this with the busway today. It's a crash with little indication as to why in a 20K line yaml file.