Handling exception.