add stream exception handle template