When you detect an error or invalid state in a function, what's the best way to handle it?
优雅的退出当你在函数中检测到一个错误或者无效状态时,最好的处理方式是什么呢? 返回一个错误代号(error code),抛出一个异常还是调用assert()?
When you detect an error or invalid state in a function, what's the best way to handle it?
优雅的退出当你在函数中检测到一个错误或者无效状态时,最好的处理方式是什么呢? 返回一个错误代号(error code),抛出一个异常还是调用assert()?
应用推荐