Add exception handle for HAL test