throwing different exceptions for different errors