typedb
typedb copied to clipboard
Restrict the type of errors that we log on the server
Description
We should restrict the type of errors that we log on the server. Expected error handling from the server side does not need to be logged - they create noise. This reduces user confidence in server stability, when the server is actually stable.
Environment
- OS (where Grakn server runs): all
- Grakn version (and platform): Grakn Core 2.0.0
- Grakn client: all
- Other environment details: NA
Reproducible Steps
Steps to create the smallest reproducible scenario:
- Run Grakn server
- Run any query that contains any potential user error (not unexpected server error), e.g. insert data before schema
- We will see server logs populated with errors.
However, the errors in server logs are not actual "server errors". They are "error handlings" of "user errors".
Expected Output
Nothing
Actual Output
Lots of stack trace
Additional information
This reduces user confidence in server stability, when the server is actually stable.
And then there are errors like the one below which should not come with a suggestion for the user to check the server logs. It's not needed as the error is expected.
As part of this work, and the more general error architecture, it would be good to have immutable error codes that don't change over time. I think a good solution to this is to have 'versions' (Just like protocol and data encoding). In the same version, we only add new errors to the end. Then we can bump the error codes version and re-sort the errors. All errors printed should have the version prepended or appended to ensure uniqueness.