add debug flag to determing if exceptions should be caught or propogated