-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fatal crash caused by force unwrap
- Loading branch information
1 parent
349f14d
commit aa08360
Showing
5 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
import Foundation | ||
import SwiftBacktrace | ||
|
||
NSSetUncaughtExceptionHandler { (exception) in | ||
let stack = exception.callStackReturnAddresses | ||
print("Stack trace: \(stack)") | ||
} | ||
|
||
func handleSignal(_ code: Int32) { | ||
print("caught crash") | ||
} | ||
|
||
signal(SIGABRT, handleSignal); | ||
signal(SIGILL, handleSignal); | ||
signal(SIGSEGV, handleSignal); | ||
signal(SIGFPE, handleSignal); | ||
signal(SIGBUS, handleSignal); | ||
signal(SIGPIPE, handleSignal); | ||
|
||
Bundler.main() | ||
|
||
// TODO: support sandboxing | ||
// TODO: add proper help messages to subcommands, options and flags | ||
// TODO: add proper help messages to subcommands, options and flags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters