summaryrefslogtreecommitdiff
path: root/src/services/api/graphql
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/api/graphql')
-rw-r--r--src/services/api/graphql/graphql/mutations.py3
-rw-r--r--src/services/api/graphql/graphql/queries.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/services/api/graphql/graphql/mutations.py b/src/services/api/graphql/graphql/mutations.py
index 1b77cff87..5ccc9b0b6 100644
--- a/src/services/api/graphql/graphql/mutations.py
+++ b/src/services/api/graphql/graphql/mutations.py
@@ -90,11 +90,12 @@ def make_mutation_resolver(mutation_name, class_name, session_func):
}
except OpModeError as e:
typename = type(e).__name__
+ msg = str(e)
return {
"success": False,
"errore": ['op_mode_error'],
"op_mode_error": {"name": f"{typename}",
- "message": op_mode_err_msg.get(typename, "Unknown"),
+ "message": msg if msg else op_mode_err_msg.get(typename, "Unknown"),
"vyos_code": op_mode_err_code.get(typename, 9999)}
}
except Exception as error:
diff --git a/src/services/api/graphql/graphql/queries.py b/src/services/api/graphql/graphql/queries.py
index 8ae61b704..b46914dcc 100644
--- a/src/services/api/graphql/graphql/queries.py
+++ b/src/services/api/graphql/graphql/queries.py
@@ -90,11 +90,12 @@ def make_query_resolver(query_name, class_name, session_func):
}
except OpModeError as e:
typename = type(e).__name__
+ msg = str(e)
return {
"success": False,
"errors": ['op_mode_error'],
"op_mode_error": {"name": f"{typename}",
- "message": op_mode_err_msg.get(typename, "Unknown"),
+ "message": msg if msg else op_mode_err_msg.get(typename, "Unknown"),
"vyos_code": op_mode_err_code.get(typename, 9999)}
}
except Exception as error: