0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/buildscripts/resmokelib/errors.py
Max Hirschhorn 6ad26a359f SERVER-35472 Avoid falling back to stderr in resmoke.py.
Instead a special return code of 75 is used to indicate that the log
output would otherwise be incomplete.
2018-06-08 12:45:15 -04:00

53 lines
1.5 KiB
Python

"""Exceptions raised by resmoke.py."""
class ResmokeError(Exception): # noqa: D204
"""Base class for all resmoke.py exceptions."""
pass
class SuiteNotFound(ResmokeError): # noqa: D204
"""A suite that isn't recognized was specified."""
pass
class StopExecution(ResmokeError): # noqa: D204
"""Exception raised when resmoke.py should stop executing tests if failing fast is enabled."""
pass
class UserInterrupt(StopExecution): # noqa: D204
"""Exception raised when a user signals resmoke.py to unconditionally stop executing tests."""
EXIT_CODE = 130 # Simulate SIGINT as exit code.
class LoggerRuntimeConfigError(StopExecution): # noqa: D204
"""Exception raised when a logging handler couldn't be configured at runtime."""
EXIT_CODE = 75
class TestFailure(ResmokeError): # noqa: D204
"""Exception raised by a hook in the after_test method.
Raised if it determines the the previous test should be marked as a failure.
"""
pass
class ServerFailure(TestFailure): # noqa: D204
"""Exception raised by a hook in the after_test method.
Raised if it detects that the fixture did not exit cleanly and should be marked
as a failure.
"""
pass
class PortAllocationError(ResmokeError): # noqa: D204
"""Exception that is raised by the PortAllocator.
Raised if a port is requested outside of the range of valid ports, or if a
fixture requests more ports than were reserved for that job.
"""
pass