mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 11:19:56 +00:00
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Added a section on documentation to the DEV_SETUP Added a check for the copyright row to pre-commit Closes #5629 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
55 lines
1.4 KiB
Python
55 lines
1.4 KiB
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
|
|
# Even though there is no strict separation between errors and exceptions in Python, it is a good practice to use:
|
|
# - Exceptions for exceptional conditions that a reasonable application may wish to catch.
|
|
# - Errors for exceptional conditions that are not reasonable to catch.
|
|
# for instance syntax errors in a template should be called ...Error,
|
|
# while rendering of the same template should raise an ...Exception.
|
|
# every error should derive from KernelException (including errors)
|
|
# all raised exceptions should use the raise ... from exc syntax to preserve the original traceback
|
|
|
|
|
|
class KernelException(Exception):
|
|
pass
|
|
|
|
|
|
class KernelServiceNotFoundError(KernelException):
|
|
pass
|
|
|
|
|
|
class KernelPluginNotFoundError(KernelException):
|
|
pass
|
|
|
|
|
|
class KernelPluginInvalidConfigurationError(KernelException):
|
|
pass
|
|
|
|
|
|
class KernelFunctionNotFoundError(KernelException):
|
|
pass
|
|
|
|
|
|
class KernelFunctionAlreadyExistsError(KernelException):
|
|
pass
|
|
|
|
|
|
class KernelInvokeException(KernelException):
|
|
pass
|
|
|
|
|
|
class OperationCancelledException(KernelException):
|
|
pass
|
|
|
|
|
|
__all__ = [
|
|
"KernelException",
|
|
"KernelFunctionAlreadyExistsError",
|
|
"KernelFunctionNotFoundError",
|
|
"KernelInvokeException",
|
|
"KernelPluginInvalidConfigurationError",
|
|
"KernelPluginNotFoundError",
|
|
"KernelServiceNotFoundError",
|
|
"OperationCancelledException",
|
|
]
|