internal/encoding/yaml: add underlying error to "cannot decode V as T"
This can be useful context that would otherwise be lost.
Some of these errors may be a bit repetitive, such as repeating
the input YAML string, but that's fine.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ia95c25566288a4f1b7403a7b1fec1fe1e13ae92e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1195045
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>