added option to raise the exception in internal calls