Adds gate exceptions handling.