Add exception processing logic