Skip to content

Commit

Permalink
Make Crashlytics actually include the debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 26, 2019
1 parent 7b999da commit 4602f9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Gifski/MainWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ final class MainWindowController: NSWindowController {
)

#if !DEBUG
Crashlytics.sharedInstance().recordError(debugInfo)
Crashlytics.sharedInstance().recordError(NSError.appError(message: debugInfo))
#endif

return
Expand All @@ -142,7 +142,7 @@ final class MainWindowController: NSWindowController {
)

#if !DEBUG
Crashlytics.sharedInstance().recordError(debugInfo)
Crashlytics.sharedInstance().recordError(NSError.appError(message: debugInfo))
#endif

return
Expand Down
10 changes: 10 additions & 0 deletions Gifski/util.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1391,3 +1391,13 @@ extension CALayer {
add(springAnimation, forKey: "")
}
}

extension NSError {
class func appError(message: String) -> Self {
return self.init(
domain: App.id,
code: 0,
userInfo: [NSLocalizedDescriptionKey: message]
)
}
}

0 comments on commit 4602f9b

Please sign in to comment.