make exception throwing configurable