Throwing Exceptions in the Deque Class