validations-libs/validations_libs/exceptions.py
Jiri Podivin e510ed451b Exceptions for Validations Framework
Introduces two new exceptions for Validation Framework
to be raised within appropriate context.

ValidationRunException - signifying incorrect behavior of the Run action code
ValidationShowException - signifying incorrect behavior of the Show actions code

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I87f315e7bb2e28a8572982a71fbe2be4432ff2c0
2022-03-24 09:17:37 +01:00

42 lines
1.6 KiB
Python

# Copyright 2022 Red Hat, Inc.
#
# 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.
#
"""This module contains Validation Framework specific exceptions,
to be raised by Validation Framework runtime.
The exceptions are meant to cover the most common of the possible
fail states the framework can encounter, with the rest evoking one
of the built in exceptions, such as 'RuntimeError'.
Use of these exceptions should be limited to cases when cause is known
and within the context of the framework itself.
"""
class ValidationRunException(Exception):
"""ValidationRunException is to be raised when actions
initiated by the CLI 'run' subcommand or `run_validations` method
of the `ValidationsActions` class, cause unacceptable behavior
from which it is impossible to recover.
"""
class ValidationShowException(Exception):
"""ValidationShowException is to be raised when actions
initiated by the CLI 'show' subcommands or `show_history`,
`show_validations` or `show_validations_parameters` methods
of the `ValidationsActions` class, cause unacceptable behavior
from which it is impossible to recover.
"""