Updated error text message.
Added exceptions.
Updated exception handling.
Added throws of exception.