summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-01-24 07:56:49 +0100
committerGitHub <noreply@github.com>2023-01-24 07:56:49 +0100
commit3e1762e97ea44dc133b793ebbd00c3376261ac6f (patch)
tree58c7746d954f3637a1d7aece82003a205c95f66f /python/vyos
parent8c957ca3d63a0d827ee4c560f11a4f6436ba5cc8 (diff)
parentb5e90197263bd59b62cf24c631cc4973c4514dd9 (diff)
downloadvyos-1x-3e1762e97ea44dc133b793ebbd00c3376261ac6f.tar.gz
vyos-1x-3e1762e97ea44dc133b793ebbd00c3376261ac6f.zip
Merge pull request #1779 from dmbaturin/T4951-resource-error
op mode: T4951: add InsufficientResources error
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/opmode.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/python/vyos/opmode.py b/python/vyos/opmode.py
index 3f1053b40..af2c7b28b 100644
--- a/python/vyos/opmode.py
+++ b/python/vyos/opmode.py
@@ -1,4 +1,4 @@
-# Copyright 2022 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright 2022-2023 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,10 @@ from humps import decamelize
class Error(Exception):
""" Any error that makes requested operation impossible to complete
for reasons unrelated to the user input or script logic.
+
+ This is the base class, scripts should not use it directly
+ and should raise more specific errors instead,
+ whenever possible.
"""
pass
@@ -45,6 +49,13 @@ class PermissionDenied(Error):
"""
pass
+class InsufficientResources(Error):
+ """ Requested operation and its arguments are valid but the system
+ does not have enough resources (such as drive space or memory)
+ to complete it.
+ """
+ pass
+
class UnsupportedOperation(Error):
""" Requested operation is technically valid but is not implemented yet. """
pass