Skip to content

Instantly share code, notes, and snippets.

View rainbowcardiod's full-sized avatar

rainbowcardiod

View GitHub Profile
@rainbowcardiod
rainbowcardiod / logAndCatch.swift
Last active June 8, 2022 12:42
nicer cacth-log-error syntax for swift
/*
Many times one does a catch and just wants to log the error,
perhaps with an utility that in the log message includes the function name and the source code line.
With catchAndLog one can do the same but with a nicer and shorter syntax.
Example, before:
do {
... code ...
} catch {