Discourage usage of NotImplementedError
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Proposal
Discourage usage of NotImplementedError.
Rationale
- Its actual meaning is different than the name implies – according to RubyDoc it should be raised when a feature is not implemented on the current platform, think of low-level things like calling
forkorfsync. - It's a descendant of
ScriptErrorso arescueblock will not capture this. This might sound like a good thing but I believe we are using the mechanism in a way that it was not meant to be used.
Solutions
- Create a RuboCop rule that either:
- Asks
NoMethodErrorwith a message wheneverNotImplementedErroris raised - Create our own exception class for this and ask developers to raise that instead
- Perhaps create an issue on Ruby Issue Tracking System so maybe we'll get a new exception class in the language itself
Edited by 🤖 GitLab Bot 🤖