Use real exceptions when type is invalid

See https://github.com/davidshimjs/jaguarjs-jsdoc/pull/31 for an update
of the jsdoc template that don't currently manage exceptions correctly

I currently use https://github.com/twidi/jaguarjs-jsdoc/tree/twidi-
current which integrates this PR and some others for the original
repository
Add a way to add a row before another