jimfoltz / SketchUp-Ruby-API-Doc

Help Document the SketchUp Ruby API using Yard
12 stars 5 forks source link

document Exceptions with @raise #14

Open Aerilius opened 9 years ago

Aerilius commented 9 years ago

The official SketchUp Ruby API often does not document unusual exceptions.

Example: The docs for String.#to_l do not mention what happens if input cannot be parsed, whether 0, nil, false is returned. One might only discover in edge cases that an exception is raised.

Statically typed languages like Java require the programmer to track all exceptions that a method could raise (void methodName() throws ArgumentError {}). This can be helpful so you are not surprised by uncaught exceptions.

I would suggest to add such info with the yardoc @raise [Types] description tag where we think it is needed.