Closed allen-zeng closed 4 years ago
Hey @allen-zeng,
thx for getting in touch.
fatalError("string") will be reported by HockeyApp but it won't show up with the error string but will be reported as a
SIGTRAP`.
Best, Benjamin
PS: I've created an item in our backlog to track this, I can't give any ETA though as this requires work in the underlying crash reporting tool.
@TroubleMakerBen, hey. Can you tell us a bit more about fatalError
handling in HockeyApp? Because at the moment we suspect that HockeyApp SDK treats fatalError
as heuristic SIGKILL's
.
@dive It looks like the fatalError
is being reported as a SIGTRAP
without the string, as you pointed out. I've done a little reading and I think that, as @TroubleMakerBen mentioned, we would need to do some more research on the subject (the original work item never ended up making it to the top of our backlog in January).
A little information:
HockeyApp's crash reporting is based on a framework called PLCrashReporter
. You might start at its website.
As far as I can tell, fatalError
doesn't do much more than print an error message and raise a signal, and if that is indeed the case, I'm not sure off hand how the printed error could be captured in an error report (not saying that it's impossible, though).
I found this archived email thread where someone asked a question similar to yours. I'm not sure who the communicating parties are (though one appears to be an Apple employee) and I don't think they are discussing PLCrashReporter
, but it is somewhat insightful nonetheless.
I hope this helps a bit!
Hey, @achocron! Yeah, it helps. We will try to investigate as well. I'll keep you posted here about the result, but right now it looks like a very annoying issue to us. We (everyone?) use fatalError()
a lot in the current era of Swift and it's very important to distinguish between SIGKILL
(+ SIG_friends) and errors that were triggered by a reason and by the app itself.
When calling
fatalError("a crash message")
in Swift, would HockeyApp's crash report catch the content of the string and display it somewhere?If it does, is it a new addition? What version was it added in?
Thanks!