|
|
|
|
|
by aiunboxed
976 days ago
|
|
This has always been a debate in my head whether to make the function return error codes or to throw those errors. Irrespective of throwing an error or returning an error you need to handle it somewhere. If you are returning an error then the type system can handle it and the person calling your function can get an idea.. while if you are throwing an error in most of the languages your caller function will not get an idea that this function can throw an error. |
|
You can have your language hide exceptions from the control flow if you wish, but they are still things that result from function calls that you should deal with. Why not make them front and center?