swift-cross-ui icon indicating copy to clipboard operation
swift-cross-ui copied to clipboard

Update force casts and force unwraps in backend impls to print custom messages on failure

Open stackotter opened this issue 1 month ago • 1 comments

At the moment the force casts and force unwraps print relatively generic messages when they cause fatal errors. We should probably replace the force casts and force unwraps with helper methods that use #function, #line, and Self to emit nicer fatal error messages

Here's one idea for a way we could format the messages,

Fatal(AppKitBackend): NSTextView is not NSButton (`updateButton(_:label:environment:action:)`, line 593)

stackotter avatar Nov 26 '25 05:11 stackotter