Closed ThibFrgsGmz closed 1 year ago
See discussion in https://github.com/fprime-community/fprime-gds/pull/129
@thomas-bc merge when you are ready!
We agreed that these changes are good, however, as a note: in F´ we expect to trap exceptions and present a clean error message to users without a confusing stack-trace. Thus the motivation here becomes one of appeasing a potentially good linter and less to beautify messages for users directly.
Change Description
This feature implements the flake8-err-msg which allows the formatting of nice error messages.
Rationale
The problem is that Python includes the line with the lift in the default traceback. This means that a user receives a message like this:
If it is longer or more complex, the duplication can be confusing for a user not used to reading tracebacks.
On the other hand, if you always assign to something like msg, you get :
There is now a more straightforward trace, less code and no double messages.
Ref - Ruff linter
Testing/Review Recommendations
Inspection is enough
Future Work
https://github.com/fprime-community/fprime-tools/pull/140