How can I implement a custom error throwing syntax in swift?
问题 I want to implement the following: throwingFunction()??.doStuff() /* if throwingFunction throws an error: print the error else returns an object with the doStuff() Method */ throwingFunction()?? /* if an error is thrown, prints the error. else execute the function without errors. */ I'm not sure where to look in the source code for examples on how do, try, catch were implemented. The Swift error docs explain how to use error handle methods that are already implemented. To be clear, I want to