Closed aroben closed 3 years ago
Looks like CI is failing on Ubuntu due to https://bugs.swift.org/browse/SR-15191.
We could make this enhancement macOS-only, or we could just leave it out. Let me know if you have any other ideas @stephencelis.
And _getEmbeddedNSError
didn't have the problem? I guess _getEmbeddedNSError
is technically public, so I'd be OK bringing it back if it avoids the issue. My initial reaction was to avoid it but may not be worth it!
Unfortunately, no. That method doesn't exist on Linux; I hadn't tested Linux at all before opening this PR.
I think your instinct to avoid it was a good one. Some Swift folks have told me that a type-based check is the intended way to do this, and the Linux behavior is a bug. I don't yet have any ideas for how to work around it on Linux though.
@stephencelis I updated the test to reflect the current behavior on Linux. It's unfortunate the behavior isn't the same as macOS, but I don't think there's much we can do about that within swift-custom-dump.
Sounds good! I'll merge when tests pass :smile: Thanks for the PR!
When dumping a Swift Error bridged to NSError, we'd only show the error domain and error code generated by the Swift runtime. We can get much better output (e.g., enum/case names, associated values, etc.) if we unwrap the Swift Error and dump it directly.