Async Failure handling in Typescript - News Summed Up

Async Failure handling in Typescript


During the editions project, I built a little wrapper for Promises which was inspired by error handling patterns from both golang and scala. In golang, functions communicate whether the have succeeded or failed by returning an error value alongside their results. Handling the value of this, handles the error encountered in the same manner as so-called ‘happy path’ code. In Scala, a common error handling strategy is for a type to either be the successful result of the function- or the reason it failed. If this way of handling errors makes sense to you, we have published this as a library called ts-failure under the MIT license for you to use in your own projects.


Source: The Guardian December 22, 2019 09:00 UTC



Loading...
Loading...
  

Loading...

                           
/* -------------------------- overlay advertisemnt -------------------------- */