Closed iamjamesim closed 2 years ago
@getsentry/team-mobile - should the text here be changed to say the Issue Details page?
If at all possible, I would like to request Sentry to show the custom description instead of the error code on the Issues page. Sadly, the error code can sometimes be completely meaningless, in which case it becomes very difficult to distinguish issues from one another.
@imatwawana I dont think this is a documentation problem but an implementation one. I'll transfer this to coca repo.
@imjamesim Thanks for pointing this out. We going to investigate.
@imjamesim, can you please share a code snippet for us to reproduce your issue?
@philipphofmann here's a snippet that shows how we're using NSDebugDescriptionErrorKey
to provide a custom debug description for Apollo's GraphQLError
:
extension GraphQLError: CustomNSError {
...
public var errorUserInfo: [String: Any] {
var userInfo = [String: Any]()
if let message = message {
userInfo[NSDebugDescriptionErrorKey] = message
}
return userInfo
}
}
I just tried
class MyError: CustomNSError {
public var errorUserInfo: [String: Any] {
var userInfo = [String: Any]()
userInfo[NSDebugDescriptionErrorKey] = "My Philipp Custom message"
return userInfo
}
}
// ...
let error = MyError()
SentrySDK.capture(error: error)
And it results in
Which SDK version are you using, @imjamesim? This feature is only available since 7.25.0. I think we have to point this out in the docs.
@philipphofmann ah we were on 7.23.0. I just confirmed this works as expected on 7.27.0. Thanks for the clarification!
Core or SDK?
Platform/SDK
Which part? Which one?
ios/usage/#customizing-error-descriptions
Description
Excerpt from Customizing Error Descriptions section on the Usage for iOS page:
Although I've added a description to the userInfo dictionary with
NSDebugDescriptionErrorKey
, I'm not seeing the description anywhere on the Issues page. I do, however, see the description under the User Info section once I click into the specific issue's details page.Suggested Solution
Show the custom descriptions on the Issues page.