added error handling

- forbids the use of digits that are out of range in the source base
system (e.g. 1337 in base 6)