Capturing Swift Error Context

Erica Sadun: Say you’re working with a type and you want to throw an error that reflects the context of where it originates. You can do that, mostly, using a few built-in compiler keywords. __FUNCTION__, __LINE__, and __FILE__ provide literal interpolation about the details of a calling function[…][…]Use a protocol to automatically pick up on … Continue reading Capturing Swift Error Context