Added check for Flask propagate_exceptions on error