Repository: caikit/caikit
Pull request #391 (2023-08-02 21:05:34)

:recycle: move exceptions to core package
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. Make sure to read the Contributing Guide before submitting your PR: https://github.com/caikit/caikit/blob/main/CONTRIBUTING.md
2. If this PR closes another issue, add 'closes #<issue number>' somewhere in the PR summary. GitHub will automatically close that issue when this PR gets merged. Alternatively, adding 'refs #<issue number>' will not close the issue, but help provide the reviewer more context.-->

**What this PR does / why we need it**:

For part of #390 

This moves the core exception stuff out of the toolkit (the kitchen-sink package) and into `caikit.core.exceptions`

**Special notes for your reviewer**:

**If applicable**:
- [ ] this PR contains documentation
- [ ] this PR contains unit tests
- [ ] this PR has been tested for backwards compatibility



Patch:
diff --git a/caikit/core/__init__.py b/caikit/core/__init__.py
index 0ea0303d..b49200af 100644
--- a/caikit/core/__init__.py
+++ b/caikit/core/__init__.py
@@ -31,6 +31,7 @@ _warnings.filterwarnings("ignore")
 
 # Local
 from .data_model import DataObjectBase, dataobject
+from .exceptions import DataValidationError, error_handler
 from .model_manager import *
 from .module_backends import *
 from .modules import ModuleBase, ModuleConfig, ModuleLoader, ModuleSaver, module
diff --git a/caikit/core/augmentors/base.py b/caikit/core/augmentors/base.py
index a5034395..f6a96267 100644
--- a/caikit/core/augmentors/base.py
+++ b/caikit/core/augmentors/base.py
@@ -20,7 +20,7 @@ import random
 import alog
 
 # Local
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 
 log = alog.use_channel("AUGMENT_BASE")
 error = error_handler.get(log)
diff --git a/caikit/core/augmentors/merged_augmentor.py b/caikit/core/augmentors/merged_augmentor.py
index 5224c1b1..101a23d1 100644
--- a/caikit/core/augmentors/merged_augmentor.py
+++ b/caikit/core/augmentors/merged_augmentor.py
@@ -19,7 +19,7 @@
 import alog
 
 # Local
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 from .base import AugmentorBase
 from .schemes import SchemeBase
 
diff --git a/caikit/core/augmentors/schemes/base.py b/caikit/core/augmentors/schemes/base.py
index 0a1ee7a8..12355cbd 100644
--- a/caikit/core/augmentors/schemes/base.py
+++ b/caikit/core/augmentors/schemes/base.py
@@ -22,7 +22,7 @@ import random
 import alog
 
 # Local
-from ...toolkit.errors import error_handler
+from ...exceptions import error_handler
 from .. import AugmentorBase
 
 log = alog.use_channel("AUG_SCHEME_BASE")
diff --git a/caikit/core/augmentors/schemes/random_multi_selection_scheme.py b/caikit/core/augmentors/schemes/random_multi_selection_scheme.py
index f70b87cb..6ad8a90f 100644
--- a/caikit/core/augmentors/schemes/random_multi_selection_scheme.py
+++ b/caikit/core/augmentors/schemes/random_multi_selection_scheme.py
@@ -22,7 +22,7 @@ import random
 import alog
 
 # Local
-from ...toolkit.errors import error_handler
+from ...exceptions import error_handler
 from .base import SchemeBase
 
 log = alog.use_channel("RMULT_AUG_SCHEME")
diff --git a/caikit/core/augmentors/schemes/random_single_selection_scheme.py b/caikit/core/augmentors/schemes/random_single_selection_scheme.py
index cf5bb2e8..9430bc67 100644
--- a/caikit/core/augmentors/schemes/random_single_selection_scheme.py
+++ b/caikit/core/augmentors/schemes/random_single_selection_scheme.py
@@ -22,7 +22,7 @@ import random
 import alog
 
 # Local
-from ...toolkit.errors import error_handler
+from ...exceptions import error_handler
 from .base import SchemeBase
 
 log = alog.use_channel("RSING_AUG_SCHEME")
diff --git a/caikit/core/data_model/base.py b/caikit/core/data_model/base.py
index 1e2a7e1e..6c20adaf 100644
--- a/caikit/core/data_model/base.py
+++ b/caikit/core/data_model/base.py
@@ -36,7 +36,7 @@ from google.protobuf.message import Message as ProtoMessageType
 import alog
 
 # Local
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 from . import enums, json_dict
 
 log = alog.use_channel("DATAM")
diff --git a/caikit/core/data_model/data_backends/dict_backend.py b/caikit/core/data_model/data_backends/dict_backend.py
index dbf6bd5c..9c6a904d 100644
--- a/caikit/core/data_model/data_backends/dict_backend.py
+++ b/caikit/core/data_model/data_backends/dict_backend.py
@@ -22,7 +22,7 @@ from typing import Any, Iterable, Type
 import alog
 
 # Local
-from ...toolkit.errors import error_handler
+from ...exceptions import error_handler
 from ..base import DataBase
 from .base import DataModelBackendBase
 
diff --git a/caikit/core/data_model/dataobject.py b/caikit/core/data_model/dataobject.py
index 4d6b08f7..b6aa9971 100644
--- a/caikit/core/data_model/dataobject.py
+++ b/caikit/core/data_model/dataobject.py
@@ -47,7 +47,7 @@ import alog
 import py_to_proto
 
 # Local
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 from . import enums
 from .base import DataBase, _DataBaseMetaClass
 from .json_dict import JsonDict
diff --git a/caikit/core/data_model/enums.py b/caikit/core/data_model/enums.py
index 9db93e30..34a9947a 100644
--- a/caikit/core/data_model/enums.py
+++ b/caikit/core/data_model/enums.py
@@ -29,7 +29,7 @@ import munch
 import alog
 
 # Local
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 
 log = alog.use_channel("DATAM")
 error = error_handler.get(log)
diff --git a/caikit/core/data_model/streams/converter.py b/caikit/core/data_model/streams/converter.py
index f9b3508d..b078891b 100644
--- a/caikit/core/data_model/streams/converter.py
+++ b/caikit/core/data_model/streams/converter.py
@@ -26,7 +26,7 @@ from typing import Callable, Dict, List
 import alog
 
 # Local
-from ...toolkit.errors import error_handler
+from ...exceptions import error_handler
 from .. import DataStream
 
 log = alog.use_channel("DATSTRMCNVRTR")
diff --git a/caikit/core/data_model/streams/csv_column_formatter.py b/caikit/core/data_model/streams/csv_column_formatter.py
index e565785d..0d9ba73d 100644
--- a/caikit/core/data_model/streams/csv_column_formatter.py
+++ b/caikit/core/data_model/streams/csv_column_formatter.py
@@ -24,7 +24,7 @@ from typing import Dict
 import alog
 
 # Local
-from ...toolkit.errors import error_handler
+from ...exceptions import error_handler
 from .. import DataStream
 
 log = alog.use_channel("CSVCLMNCNSLDTR")
diff --git a/caikit/core/data_model/streams/data_stream.py b/caikit/core/data_model/streams/data_stream.py
index b4af8cf2..49a061a0 100644
--- a/caikit/core/data_model/streams/data_stream.py
+++ b/caikit/core/data_model/streams/data_stream.py
@@ -36,8 +36,8 @@ import alog
 
 # Local
 from ...augmentors import AugmentorBase
+from ...exceptions import error_handler
 from ...toolkit import fileio
-from ...toolkit.errors import error_handler
 
 log = alog.use_channel("DATSTRM")
 error = error_handler.get(log)
diff --git a/caikit/core/data_model/streams/resolver.py b/caikit/core/data_model/streams/resolver.py
index d302c9e0..8526792e 100644
--- a/caikit/core/data_model/streams/resolver.py
+++ b/caikit/core/data_model/streams/resolver.py
@@ -22,7 +22,7 @@ from typing import Dict
 import alog
 
 # Local
-from ...toolkit.errors import error_handler
+from ...exceptions import error_handler
 from .. import DataStream
 from .converter import DataStreamConverter
 from .csv_column_formatter import CSVColumnFormatter
diff --git a/caikit/core/data_model/streams/validator.py b/caikit/core/data_model/streams/validator.py
index 37b5deb7..cfcaeef8 100644
--- a/caikit/core/data_model/streams/validator.py
+++ b/caikit/core/data_model/streams/validator.py
@@ -25,7 +25,8 @@ from typing import Dict
 import alog
 
 # Local
-from ...toolkit.errors import DataValidationError, error_handler
+from ...exceptions import error_handler
+from ...exceptions.validation_error import DataValidationError
 from .. import DataStream
 
 log = alog.use_channel("DATSTRMVLDTR")
diff --git a/caikit/core/exceptions/__init__.py b/caikit/core/exceptions/__init__.py
new file mode 100644
index 00000000..dc2384de
--- /dev/null
+++ b/caikit/core/exceptions/__init__.py
@@ -0,0 +1,17 @@
+# Copyright The Caikit Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Local
+from . import error_handler
+from .validation_error import DataValidationError
diff --git a/caikit/core/toolkit/errors/error_handler.py b/caikit/core/exceptions/error_handler.py
similarity index 100%
rename from caikit/core/toolkit/errors/error_handler.py
rename to caikit/core/exceptions/error_handler.py
diff --git a/caikit/core/toolkit/errors/validation_error.py b/caikit/core/exceptions/validation_error.py
similarity index 100%
rename from caikit/core/toolkit/errors/validation_error.py
rename to caikit/core/exceptions/validation_error.py
diff --git a/caikit/core/model_management/factories.py b/caikit/core/model_management/factories.py
index bb7ab0c3..7b4d0908 100644
--- a/caikit/core/model_management/factories.py
+++ b/caikit/core/model_management/factories.py
@@ -22,7 +22,7 @@ import importlib
 import alog
 
 # Local
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 from ..toolkit.factory import Factory, FactoryConstructible
 from .local_model_finder import LocalModelFinder
 from .local_model_initializer import LocalModelInitializer
diff --git a/caikit/core/model_management/local_model_finder.py b/caikit/core/model_management/local_model_finder.py
index 92235a21..623a05bb 100644
--- a/caikit/core/model_management/local_model_finder.py
+++ b/caikit/core/model_management/local_model_finder.py
@@ -34,8 +34,8 @@ import aconfig
 import alog
 
 # Local
+from ..exceptions import error_handler
 from ..modules import ModuleConfig
-from ..toolkit.errors import error_handler
 from .model_finder_base import ModelFinderBase
 
 log = alog.use_channel("LFIND")
diff --git a/caikit/core/model_management/local_model_initializer.py b/caikit/core/model_management/local_model_initializer.py
index 765e7198..6057458e 100644
--- a/caikit/core/model_management/local_model_initializer.py
+++ b/caikit/core/model_management/local_model_initializer.py
@@ -36,6 +36,7 @@ import aconfig
 import alog
 
 # Local
+from ..exceptions import error_handler
 from ..module_backends import BackendBase, backend_types
 from ..modules import ModuleBase, ModuleConfig
 from ..modules.decorator import SUPPORTED_LOAD_BACKENDS_VAR_NAME
@@ -44,7 +45,6 @@ from ..registries import (
     module_backend_registry,
     module_backend_types,
 )
-from ..toolkit.errors import error_handler
 from .model_initializer_base import ModelInitializerBase
 
 log = alog.use_channel("LLOAD")
diff --git a/caikit/core/model_management/local_model_trainer.py b/caikit/core/model_management/local_model_trainer.py
index 4cdf16a2..11345e08 100644
--- a/caikit/core/model_management/local_model_trainer.py
+++ b/caikit/core/model_management/local_model_trainer.py
@@ -31,10 +31,10 @@ import alog
 # Local
 from ...interfaces.common.data_model.stream_sources import S3Path
 from ..data_model import TrainingStatus
+from ..exceptions import error_handler
 from ..modules import ModuleBase
 from ..toolkit.destroyable_process import DestroyableProcess
 from ..toolkit.destroyable_thread import DestroyableThread
-from ..toolkit.errors import error_handler
 from ..toolkit.logging import configure as configure_logging
 from .model_trainer_base import ModelTrainerBase, TrainingInfo
 import caikit
diff --git a/caikit/core/model_manager.py b/caikit/core/model_manager.py
index 7cd34ff0..80d18151 100644
--- a/caikit/core/model_manager.py
+++ b/caikit/core/model_manager.py
@@ -30,6 +30,7 @@ import alog
 
 # Local
 from ..interfaces.common.data_model.stream_sources import S3Path
+from .exceptions import error_handler
 from .model_management import (
     ModelFinderBase,
     ModelInitializerBase,
@@ -40,7 +41,6 @@ from .model_management import (
 )
 from .modules.base import ModuleBase
 from .registries import module_registry
-from .toolkit.errors import error_handler
 from .toolkit.factory import Factory, FactoryConstructible
 from caikit.config import get_config
 
diff --git a/caikit/core/module_backends/backend_types.py b/caikit/core/module_backends/backend_types.py
index 8656303b..7b5e44d1 100644
--- a/caikit/core/module_backends/backend_types.py
+++ b/caikit/core/module_backends/backend_types.py
@@ -23,8 +23,8 @@ from typing import Optional, Type
 import alog
 
 # Local
+from ..exceptions import error_handler
 from ..registries import module_backend_classes, module_backend_types
-from ..toolkit.errors import error_handler
 from ..toolkit.wip_decorator import Action, WipCategory, work_in_progress
 from .base import BackendBase
 
diff --git a/caikit/core/module_backends/local_backend.py b/caikit/core/module_backends/local_backend.py
index 567de1bb..79a83db5 100644
--- a/caikit/core/module_backends/local_backend.py
+++ b/caikit/core/module_backends/local_backend.py
@@ -19,7 +19,7 @@
 import alog
 
 # Local
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 from ..toolkit.wip_decorator import TempDisableWIP
 from .backend_types import register_backend_type
 from .base import BackendBase
diff --git a/caikit/core/modules/base.py b/caikit/core/modules/base.py
index 417e324d..4f9fa468 100644
--- a/caikit/core/modules/base.py
+++ b/caikit/core/modules/base.py
@@ -37,8 +37,9 @@ import alog
 
 # Local
 from ..data_model import DataBase, DataStream
+from ..exceptions import error_handler
+from ..exceptions.validation_error import DataValidationError
 from ..toolkit import fileio
-from ..toolkit.errors import DataValidationError, error_handler
 from .loader import ModuleLoader
 from .meta import _ModuleBaseMeta
 from caikit import core
diff --git a/caikit/core/modules/config.py b/caikit/core/modules/config.py
index 50b3b465..262197b8 100644
--- a/caikit/core/modules/config.py
+++ b/caikit/core/modules/config.py
@@ -21,7 +21,7 @@ import alog
 
 # Local
 from .. import toolkit
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 
 log = alog.use_channel("MODULE_CFG")
 error = error_handler.get(log)
diff --git a/caikit/core/modules/decorator.py b/caikit/core/modules/decorator.py
index fea6bef9..d1326ce9 100644
--- a/caikit/core/modules/decorator.py
+++ b/caikit/core/modules/decorator.py
@@ -28,10 +28,10 @@ import alog
 
 # Local
 from ..data_model import ProducerId
+from ..exceptions import error_handler
 from ..registries import module_backend_registry, module_backend_types, module_registry
 from ..signature_parsing import CaikitMethodSignature
 from ..task import TaskBase
-from ..toolkit.errors import error_handler
 from .base import ModuleBase
 import caikit.core
 
diff --git a/caikit/core/modules/loader.py b/caikit/core/modules/loader.py
index a0b7b3bd..94936ad8 100644
--- a/caikit/core/modules/loader.py
+++ b/caikit/core/modules/loader.py
@@ -23,7 +23,7 @@ import os
 import alog
 
 # Local
-from ..toolkit.errors import error_handler
+from ..exceptions import error_handler
 from .config import ModuleConfig
 from caikit import core
 
diff --git a/caikit/core/modules/meta.py b/caikit/core/modules/meta.py
index 45f68118..e88a8bb5 100644
--- a/caikit/core/modules/meta.py
+++ b/caikit/core/modules/meta.py
@@ -73,8 +73,8 @@ import functools
 import alog
 
 # Local
+from ..exceptions import error_handler
 from .config import ModuleConfig
-from caikit.core.toolkit.errors import error_handler
 
 log = alog.use_channel("METADATA_INJECT")
 error = error_handler.get(log)
diff --git a/caikit/core/modules/saver.py b/caikit/core/modules/saver.py
index 8343e9c5..d6b0024e 100644
--- a/caikit/core/modules/saver.py
+++ b/caikit/core/modules/saver.py
@@ -27,9 +27,9 @@ import uuid
 import alog
 
 # Local
+from ..exceptions import error_handler
 from ..modules.config import ModuleConfig
 from ..toolkit import ObjectSerializer
-from ..toolkit.errors import error_handler
 from ..toolkit.wip_decorator import TempDisableWIP
 from .base import ModuleBase
 from .loader import ModuleLoader
diff --git a/caikit/core/registries.py b/caikit/core/registries.py
index 259a5477..53305a30 100644
--- a/caikit/core/registries.py
+++ b/caikit/core/registries.py
@@ -25,7 +25,7 @@ from typing import Any, Dict, Tuple, Type
 import alog
 
 # Local
-from .toolkit.errors import error_handler
+from .exceptions import error_handler
 
 log = alog.use_channel("REGISTRIES")
 error = error_handler.get(log)
diff --git a/caikit/core/task.py b/caikit/core/task.py
index 9dfd9ea6..d251901a 100644
--- a/caikit/core/task.py
+++ b/caikit/core/task.py
@@ -24,8 +24,8 @@ from alog import alog
 # Local
 from .data_model import DataStream
 from .data_model.base import DataBase
+from .exceptions import error_handler
 from .signature_parsing import CaikitMethodSignature
-from .toolkit.errors import error_handler
 
 log = alog.use_channel("TASK_BASE")
 error = error_handler.get(log)
diff --git a/caikit/core/toolkit/__init__.py b/caikit/core/toolkit/__init__.py
index 273be365..c6a947d9 100644
--- a/caikit/core/toolkit/__init__.py
+++ b/caikit/core/toolkit/__init__.py
@@ -18,7 +18,6 @@ may find helpful methods in here for more advanced use of this library.
 """
 # Local
 from . import compatibility, logging
-from .errors import *
 from .fileio import *
 from .quality_evaluation import (
     EvalTypes,
diff --git a/caikit/core/toolkit/compatibility.py b/caikit/core/toolkit/compatibility.py
index a1ff8137..157a1321 100644
--- a/caikit/core/toolkit/compatibility.py
+++ b/caikit/core/toolkit/compatibility.py
@@ -21,7 +21,7 @@ import sys
 import alog
 
 # Local
-from .errors import error_handler
+from ..exceptions import error_handler
 
 log = alog.use_channel("COMPATIBILITY")
 error = error_handler.get(log)
diff --git a/caikit/core/toolkit/errors/__init__.py b/caikit/core/toolkit/errors/__init__.py
index ce5d267a..58e5565b 100644
--- a/caikit/core/toolkit/errors/__init__.py
+++ b/caikit/core/toolkit/errors/__init__.py
@@ -13,5 +13,20 @@
 # limitations under the License.
 
 
+"""This file exists for backwards compatibility.
+It imports from the caikit.core.exceptions package where things moved"""
+
+# Standard
+import warnings as _warnings
+
 # Local
-from .validation_error import DataValidationError
+from caikit.core.exceptions import DataValidationError, error_handler
+
+# 🌶️🌶️🌶️ Warn if this package is ever imported
+# Allow DeprecationWarnings through if anything tries to import from `toolkit.errors`
+_warnings.filterwarnings("default", category=DeprecationWarning)
+# And actually warn them
+_warnings.warn(
+    "The caikit.toolkit.errors package has moved to caikit.core.exceptions",
+    DeprecationWarning,
+)
diff --git a/caikit/core/toolkit/factory.py b/caikit/core/toolkit/factory.py
index c2682978..e5b88cb7 100644
--- a/caikit/core/toolkit/factory.py
+++ b/caikit/core/toolkit/factory.py
@@ -25,7 +25,7 @@ import aconfig
 import alog
 
 # Local
-from .errors import error_handler
+from ..exceptions import error_handler
 
 log = alog.use_channel("FCTRY")
 error = error_handler.get(log)
diff --git a/caikit/core/toolkit/quality_evaluation.py b/caikit/core/toolkit/quality_evaluation.py
index 6aaacdf3..f5700688 100644
--- a/caikit/core/toolkit/quality_evaluation.py
+++ b/caikit/core/toolkit/quality_evaluation.py
@@ -26,7 +26,7 @@ import re
 import alog
 
 # Local
-from .errors import error_handler
+from ..exceptions import error_handler
 
 log = alog.use_channel("TLKIT")
 error = error_handler.get(log)
diff --git a/caikit/core/toolkit/wip_decorator.py b/caikit/core/toolkit/wip_decorator.py
index c5dfcf8a..58022ca0 100644
--- a/caikit/core/toolkit/wip_decorator.py
+++ b/caikit/core/toolkit/wip_decorator.py
@@ -22,7 +22,7 @@ import inspect
 import alog
 
 # Local
-from .errors import error_handler
+from ..exceptions import error_handler
 
 log = alog.use_channel("WIPDC")
 error = error_handler.get(log)
diff --git a/caikit/interfaces/common/data_model/producer.py b/caikit/interfaces/common/data_model/producer.py
index 868de170..ec28ea74 100644
--- a/caikit/interfaces/common/data_model/producer.py
+++ b/caikit/interfaces/common/data_model/producer.py
@@ -25,7 +25,7 @@ from caikit.core.data_model import (
     ProducerId,
     dataobject,
 )
-from caikit.core.toolkit.errors import error_handler
+from caikit.core.exceptions import error_handler
 
 log = alog.use_channel("DATAM")
 error = error_handler.get(log)
diff --git a/caikit/runtime/model_management/loaded_model.py b/caikit/runtime/model_management/loaded_model.py
index de3ca51d..0b318a1b 100644
--- a/caikit/runtime/model_management/loaded_model.py
+++ b/caikit/runtime/model_management/loaded_model.py
@@ -26,7 +26,7 @@ import alog
 
 # Local
 from caikit.core import ModuleBase
-from caikit.core.toolkit.errors import error_handler
+from caikit.core.exceptions import error_handler
 from caikit.runtime.types.caikit_runtime_exception import CaikitRuntimeException
 
 log = alog.use_channel("LOADED-MODEL")
diff --git a/caikit/runtime/model_management/model_manager.py b/caikit/runtime/model_management/model_manager.py
index 486b2708..1637f9d9 100644
--- a/caikit/runtime/model_management/model_manager.py
+++ b/caikit/runtime/model_management/model_manager.py
@@ -30,7 +30,7 @@ import alog
 # Local
 from caikit import get_config
 from caikit.core import ModuleBase
-from caikit.core.toolkit.errors import error_handler
+from caikit.core.exceptions import error_handler
 from caikit.runtime.model_management.loaded_model import LoadedModel
 from caikit.runtime.model_management.model_loader import ModelLoader
 from caikit.runtime.model_management.model_sizer import ModelSizer
diff --git a/caikit/runtime/service_generation/data_stream_source.py b/caikit/runtime/service_generation/data_stream_source.py
index 607de0a8..3ea47658 100644
--- a/caikit/runtime/service_generation/data_stream_source.py
+++ b/caikit/runtime/service_generation/data_stream_source.py
@@ -29,7 +29,7 @@ import alog
 from caikit.core.data_model.base import DataBase
 from caikit.core.data_model.dataobject import _make_oneof_init, make_dataobject
 from caikit.core.data_model.streams.data_stream import DataStream
-from caikit.core.toolkit.errors import error_handler
+from caikit.core.exceptions import error_handler
 from caikit.interfaces.common.data_model.stream_sources import (
     Directory,
     File,
diff --git a/caikit/runtime/servicers/global_train_servicer.py b/caikit/runtime/servicers/global_train_servicer.py
index 175700f1..9c87a74a 100644
--- a/caikit/runtime/servicers/global_train_servicer.py
+++ b/caikit/runtime/servicers/global_train_servicer.py
@@ -41,7 +41,7 @@ from caikit.runtime.utils.servicer_util import (
 import caikit.core
 
 log = alog.use_channel("GT-SERVICR-I")
-error = caikit.core.toolkit.errors.error_handler.get(log)
+error = caikit.core.exceptions.error_handler.get(log)
 
 # Protobuf non primitives
 # Ref: https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.descriptor


Test patch:
diff --git a/tests/core/data_model/streams/test_resolver.py b/tests/core/data_model/streams/test_resolver.py
index 6bbef561..a759329a 100644
--- a/tests/core/data_model/streams/test_resolver.py
+++ b/tests/core/data_model/streams/test_resolver.py
@@ -22,7 +22,7 @@ import uuid
 # Local
 from caikit.core.data_model import DataStream
 from caikit.core.data_model.streams.resolver import DataStreamResolver
-from caikit.core.toolkit.errors import DataValidationError
+from caikit.core.exceptions.validation_error import DataValidationError
 from tests.base import TestCaseBase
 
 
diff --git a/tests/core/data_model/streams/test_validator.py b/tests/core/data_model/streams/test_validator.py
index 78b121d8..7ad1ae99 100644
--- a/tests/core/data_model/streams/test_validator.py
+++ b/tests/core/data_model/streams/test_validator.py
@@ -15,7 +15,7 @@
 # Local
 from caikit.core.data_model import DataStream
 from caikit.core.data_model.streams.validator import DataStreamValidator
-from caikit.core.toolkit.errors import DataValidationError
+from caikit.core.exceptions.validation_error import DataValidationError
 
 # Unit Test Infrastructure
 from tests.base import TestCaseBase
diff --git a/tests/core/toolkit/test_error_handler.py b/tests/core/toolkit/test_error_handler.py
index 5cf56d2b..ed0908f4 100644
--- a/tests/core/toolkit/test_error_handler.py
+++ b/tests/core/toolkit/test_error_handler.py
@@ -24,7 +24,7 @@ import pytest
 import alog
 
 # Local
-from caikit.core.toolkit.errors import error_handler
+from caikit.core.exceptions import error_handler
 
 # Unit Test Infrastructure
 from tests.base import TestCaseBase