Better Sentry messages

This commit is contained in:
Shadowfacts 2022-12-31 16:57:43 -05:00
parent 5027660b52
commit ae7962ae50
2 changed files with 2 additions and 1 deletions

View File

@ -153,7 +153,7 @@ class MastodonCachePersistentStore: NSPersistentCloudKitContainer {
loadPersistentStores { (description, error) in loadPersistentStores { (description, error) in
if let error = error { if let error = error {
logger.error("Unable to load persistent store: \(String(describing: error), privacy: .public)") logger.error("Unable to load persistent store: \(String(describing: error), privacy: .public)")
fatalError("Unable to load persistent store") fatalError("Unable to load persistent store: \(String(describing: error))")
} }
if description.configuration == "Cloud" { if description.configuration == "Cloud" {

View File

@ -59,6 +59,7 @@ extension ToastConfiguration {
switch error.type { switch error.type {
case .invalidRequest, .invalidResponse, .invalidModel(_), .mastodonError(_): case .invalidRequest, .invalidResponse, .invalidModel(_), .mastodonError(_):
SentrySDK.capture(error: error) { scope in SentrySDK.capture(error: error) { scope in
scope.setFingerprint([String(describing: error)])
let crumb = Breadcrumb(level: .error, category: "error") let crumb = Breadcrumb(level: .error, category: "error")
crumb.message = title crumb.message = title
crumb.data = [ crumb.data = [