diff --git a/error.c b/error.c index 878ec81d13..ec161e5662 100644 --- a/error.c +++ b/error.c @@ -3012,14 +3012,28 @@ syserr_eqq(VALUE self, VALUE exc) /* * Document-class: NotImplementedError * - * Raised when a feature is not implemented on the current platform. For - * example, methods depending on the +fsync+ or +fork+ system calls may - * raise this exception if the underlying operating system or Ruby - * runtime does not support them. + * Raised when a method is called for a feature that is not implemented. * - * Note that if +fork+ raises a +NotImplementedError+, then + * This may be raised when the current platform does not support certain features. + * For example, methods depending on +fsync+ or +fork+ system calls may raise + * this exception when the underlying operating system or Ruby runtime + * does not support them. Note that if +fork+ raises a +NotImplementedError+, then * respond_to?(:fork) returns +false+. - */ + * + * This may also be raised by abstract methods which require implementation by + * an extending class in the calling application or library. For instance: + * + * def calculate + * raise NotImplementedError, "#{__method__} needs to be implemented by the extending class" + * end + * + * raises the exception: + * + * NotImplementedError: calculate needs to be implemented by the extending class + * + * Keep in mind: NotImplementedError is not a descendant of StandardError and will + * not be rescued by a rescue clause without an explicit Exception class. +*/ /* * Document-class: NameError