shannah / Java-Objective-C-Bridge

A thin bridge that allows for two-way communication from Java to Objective-C.
123 stars 25 forks source link

Remove Throwable.printStackTrace(...) usage #28

Closed Marcono1234 closed 3 years ago

Marcono1234 commented 3 years ago

There are a few methods using Throwable.printStackTrace(...). Often System.err might not be visible or the user will not see it, so throwing an exception is more appropriate:

The printStackTrace calls in the static initializer of RuntimeUtils might make sense since you apparently don't want to throw an exception instead (though this would at least fail early; I doubt that any user is checking RuntimeUtils.loaded), but I think the static intializer should probably not call init(); if loading the native lib failed.