Throw error instead of exiting