summaryrefslogtreecommitdiff
path: root/lib/lib_errors.c
diff options
context:
space:
mode:
authorEmanuele Di Pascale <emanuele@voltanet.io>2018-11-09 16:13:12 +0100
committerEmanuele Di Pascale <emanuele@voltanet.io>2018-12-18 15:15:26 +0100
commit625b70e3da7b1ec163607cc7354404904eacf36e (patch)
tree1f94af0d2bb967420a776f62b8fefb5d0bb2a05d /lib/lib_errors.c
parent9e7367db491b9c25a05b5d04ba6dbc0a7a0d90d8 (diff)
lib: add NB phase-specific error codes
As suggested by Renato, add error codes that are specific to the various phases of a northbound callback. These can be used by the daemons when logging an error. The reasoning is that validation errors typically mean that there is an inconsistency in the configuration, a prepare error means that we are running out of resources, and abort/apply errors are bugs that need to be reported to the devs. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'lib/lib_errors.c')
-rw-r--r--lib/lib_errors.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/lib_errors.c b/lib/lib_errors.c
index b1ed7d2f6b..7e428f135c 100644
--- a/lib/lib_errors.c
+++ b/lib/lib_errors.c
@@ -105,10 +105,16 @@ static struct log_ref ferr_lib_warn[] = {
.suggestion = "Check if the installed FRR YANG modules are in sync with the FRR binaries",
},
{
- .code = EC_LIB_NB_CB_CONFIG,
- .title = "A northbound configuration callback has failed",
- .description = "The northbound subsystem has detected that a callback used to process a configuration change has returned an error",
- .suggestion = "The log message should contain further details on the specific error that occurred; investigate the reported error.",
+ .code = EC_LIB_NB_CB_CONFIG_VALIDATE,
+ .title = "A northbound configuration callback has failed in the VALIDATE phase",
+ .description = "A callback used to process a configuration change has returned a validation error",
+ .suggestion = "The provided configuration is invalid. Fix any inconsistency and try again.",
+ },
+ {
+ .code = EC_LIB_NB_CB_CONFIG_PREPARE,
+ .title = "A northbound configuration callback has failed in the PREPARE phase",
+ .description = "A callback used to process a configuration change has returned a resource allocation error",
+ .suggestion = "The system might be running out of resources. Check the log for more details.",
},
{
.code = EC_LIB_NB_CB_STATE,
@@ -327,6 +333,18 @@ static struct log_ref ferr_lib_err[] = {
.suggestion = "Open an Issue with all relevant log files and restart FRR"
},
{
+ .code = EC_LIB_NB_CB_CONFIG_ABORT,
+ .title = "A northbound configuration callback has failed in the ABORT phase",
+ .description = "A callback used to process a configuration change has returned an error while trying to abort a change",
+ .suggestion = "Gather log data and open an Issue.",
+ },
+ {
+ .code = EC_LIB_NB_CB_CONFIG_APPLY,
+ .title = "A northbound configuration callback has failed in the APPLY phase",
+ .description = "A callback used to process a configuration change has returned an error while applying the changes",
+ .suggestion = "Gather log data and open an Issue.",
+ },
+ {
.code = END_FERR,
}
};