Issue 5228 - Add GetOptException and document exceptions

https://d.puremagic.com/issues/show_bug.cgi?id=5228