Add toggle for throwing exceptions