Removed 'white' setting from jshint rc file as it causes errors for an indented switch statement, moved error handling to util function