fix jsdoc, throw nice error message