Eigene Fehlerausgaben erzeugen

// Throw TypeError message
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");

// Throw anonymous error message
throw new Error('An error occurred');

// Throw an own type of error message
throw {
  name: 'Variable Error',
  message: 'A mandatory value was not defined.'
}

 

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *