You need to sign in or sign up before continuing.×
7 kyu

Error Throwing - Error Handling #2

Description:

Error Throwing - Error Handling #2

Error Handling is very important in coding. Most error handling seems to be overlooked or not implemented properly.

Task

In this kata you are provided to evaluate a string, you must check for any HTML code (i.e. if any HTML tags are found), if any code is found you must return false, If the input is not a string you must throw a TypeError, if the string is over 255 characters long or contains 0 characters you must throw a RangeError and last of all if the string entered is null throw a ReferenceError.

Error Messages

ReferenceError

new ReferenceError('Message is null!')

TypeError

new TypeError(`Message should be of type string but was of type ${typeof msg}!`)

RangeError

new RangeError(`Message contains ${msg.length} characters!`)
Strings
Fundamentals

Stats:

CreatedSep 2, 2015
PublishedSep 3, 2015
Warriors Trained1339
Total Skips12
Total Code Submissions5552
Total Times Completed836
JavaScript Completions836
Total Stars13
% of votes with a positive feedback rating84% of 113
Total "Very Satisfied" Votes83
Total "Somewhat Satisfied" Votes23
Total "Not Satisfied" Votes7
Ad
Contributors
  • matt c Avatar
  • ooflorent Avatar
  • myjinxin2015 Avatar
  • Voile Avatar
Ad