Allow raise_on_error flag to be passed to the constructor