Allow `onUncaughtError` to be specified from options

If the configuration options specify `metaData`, then onUncaughtError is no longer a function and causes additional errors. This fix allows `onUncaughtError` to be specified or correctly fall back to the default.