Error handling

Handles errors in input