Skip to content

Instantly share code, notes, and snippets.

@verec
Created December 31, 2015 18:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save verec/dfd220d0751f3f74d702 to your computer and use it in GitHub Desktop.
Save verec/dfd220d0751f3f74d702 to your computer and use it in GitHub Desktop.
What Erica meant to write when showing off 1TBS
public extension Contextualizable {
public func BuildContextError( items: Any...,
file: String = (__FILE__ as NSString).lastPathComponent,
function: String = __FUNCTION__,
line: Int = __LINE__) -> CoreError {
let reasons = items.map({"\($0)"}).joinWithSeparator(", ")
let context = "\(function):\(self.dynamicType):\(file):\(line) "
return CoreError(reasons, context)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment