Allow non-block functions that throw instead of return (closes #2959)