function eventFromUnknownInput(exception, hint) {
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    var ex = exception;
    var providedMechanism = hint && hint.data && hint.data.mechanism;
    var mechanism = providedMechanism || {
        handled: true,
        type: 'generic',
    };
    if (!isError$1(exception)) {
        if (isPlainObject$1(exception)) {
            // This will allow us to group events based on top-level keys
            // which is much better than creating new group when any key/value change
            var message = "Non-Error exception captured with keys: " + extractExceptionKeysForMessage(exception);
            getCurrentHub().configureScope(function (scope) {
                scope.setExtra('__serialized__', normalizeToSize(exception));
            });
            ex = (hint && hint.syntheticException) || new Error(message);
            ex.message = message;
        }
        else {
            // This handles when someone does: `throw "something awesome";`
            // We use synthesized Error here so we can extract a (rough) stack trace.
            ex = (hint && hint.syntheticException) || new Error(exception);
            ex.message = exception;
        }
        mechanism.synthetic = true;
    }
    var event = {
        exception: {
            values: [exceptionFromError(ex)],
        },
    };
    addExceptionTypeValue(event, undefined, undefined);
    addExceptionMechanism(event, mechanism);
    return __assign$5(__assign$5({}, event), { event_id: hint && hint.event_id });
}
Builds and Event from a Exception
@hidden