edtlib: wrap DTError

Don't let a malformed devicetree escape as a DTError. Wrap it in an
EDTError instead, so callers can just rely on the edtlib APIs as is
generally expected.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2021-12-03 15:52:05 -08:00 committed by Anas Nashif
commit 6c65b15ce6

View file

@ -201,7 +201,10 @@ class EDT:
self.dts_path = dts
self.bindings_dirs = bindings_dirs
try:
self._dt = DT(dts)
except DTError as e:
raise EDTError(e) from e
_check_dt(self._dt)
self._init_compat2binding()