Enable custom exception messages to be raised from SAL Server #46
Labels
Feature
Issues or MRs that add, improve or maintain features
Priority: 2
NORMAL: A task which is not critical and should be addressed when there are no higher priority issue
Description
The Flask implementation of the SAL server relies on all exception types (and their messages) being defined when the server is initialised. This means that context specific messages (i.e. origin of the exception) cannot be returned to the client.
Suggested fix
Remove the server
error_map
and subclassflask_restful.Api
to provide the ability to return custom exception messages.Additional context
Although commonly a generic exception message (i.e.
NodeNotFound: The supplied path does not point to a valid node.
) will be sufficient for the client, occasionally additional context will be beneficial. For example, if the SAL server is interacting with a backend with a large number of exception types, there will be a many-to-one mapping to SAL exception types; in this instance being able to communicate the specific backend error message to the user could be useful.The text was updated successfully, but these errors were encountered: