From c5a4e881debcc75bdb96cdddd4abda10fd778b68 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 22 Jun 2021 21:40:20 +0200 Subject: Improved error handling. --- pyGHDL/libghdl/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pyGHDL/libghdl') diff --git a/pyGHDL/libghdl/__init__.py b/pyGHDL/libghdl/__init__.py index 0d3c75fa1..525710590 100644 --- a/pyGHDL/libghdl/__init__.py +++ b/pyGHDL/libghdl/__init__.py @@ -37,6 +37,7 @@ import os import sys from pathlib import Path from shutil import which +from typing import List from pydecor import export @@ -48,7 +49,15 @@ from pyGHDL.libghdl.version import __version__ class LibGHDLException(GHDLBaseException): - pass + _internalErrors: List[str] + + def __init__(self, message: str, errors: List[str]): + super().__init__(message) + self._internalErrors = errors + + @property + def InternalErrors(self): + return self._internalErrors def _get_libghdl_name() -> Path: -- cgit v1.2.3