Zakrok09/ts-automata

REFACTOR: Improve types of Exceptions

Zakrok09 opened this issue · 0 comments

Problem

The exceptions present are not helpful. Currently there are only two IllegalArgument IllegalAutomatonState.

Solution

Introduce more exceptions.

Extending from IllegalArgument:

  • InputNotInAlphabet(c:char) - to deal with situations where the character is not part of the automaton alphabet
  • UnkownState(stateName:string) - to deal with when the input state does not exist
  • StateAlreadyExists(stateName:string) - to deal with adding of state if it already exists