From c3646b2fd2a0611f7839b88bd0c055182fe7a3f7 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 30 Jul 2024 22:43:35 -0700 Subject: [PATCH] use a custom exception --- opencl_fdfd/ops.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opencl_fdfd/ops.py b/opencl_fdfd/ops.py index c2d73ed..335392b 100644 --- a/opencl_fdfd/ops.py +++ b/opencl_fdfd/ops.py @@ -25,6 +25,11 @@ from .csr import CSRMatrix logger = logging.getLogger(__name__) + +class FDFDError(Exception): + """ Custom error for opencl_fdfd """ + pass + # Create jinja2 env on module load jinja_env = jinja2.Environment(loader=jinja2.PackageLoader(__name__, 'kernels')) @@ -52,7 +57,7 @@ def type_to_C( numpy.complex128: 'cdouble_t', } if float_type not in types: - raise Exception('Unsupported type') + raise FDFDError('Unsupported type') return types[float_type]