Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with swift-system SPM for errno types? #5

Open
SwiftNativeDeveloper opened this issue Jan 7, 2022 · 3 comments
Open

Integration with swift-system SPM for errno types? #5

SwiftNativeDeveloper opened this issue Jan 7, 2022 · 3 comments

Comments

@SwiftNativeDeveloper
Copy link

When I was checking out some new Apple SPM's I discovered Swift System and thought that there would be opportunity to use the official 'Errno.swift' in conjunction with the diagnostic payloads.

Specifically properties on the MXCrashDiagnostic like exceptionType, exceptionCode, signal, etc. have Errno mappings that are more meaningful than the MetricKit NSNumber that is provided.

Thoughts if this would compliment the goal of this library?

@mattmassicotte
Copy link
Contributor

I wasn’t aware of Swift System, thanks for pointing it out!

I’m afraid, though that none of the MXCrashDiagnostic properties are errno values. signal is a code from signal.h, exceptionType and exceptionCode are mach exception constants from mach/exc.h (doing this from memory, could be wrong on header name).

However, I do think it’s reasonable to incorporate some decoding of these values into Meter.

@SwiftNativeDeveloper
Copy link
Author

Named enums or struct instances are much more swift-y than the NSNumber. It has been a while since I looked at signal header file so I probably mixed up some of the mapping in my head.

@mattmassicotte
Copy link
Contributor

Yeah agreed. My goal was to mirror the underlying API as much as possible, but I think it is a great idea to add an additional API that offers decoded values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants