sdk/src/sync/pushError.js
function handlePushError(pushError, pushHandler) {
    return Platform.async(function(callback) {
        callback();
    })().then(function() {
        
        if (pushError.isConflict()) {
            if (pushHandler && pushHandler.onConflict) {
                // NOTE: value of server record will not be available in case of 409.
                return pushHandler.onConflict(pushError);
            }
        } else if (pushHandler && pushHandler.onError) {
            return pushHandler.onError(pushError);
        }

    }).then(undefined, function(error) {
        // Set isHandled to false even if the user has set it to handled if the onConflict / onError failed 
        pushError.isHandled = false;
    });
}
function handlePushError(pushError, pushHandler) {
    return Platform.async(function(callback) {
        callback();
    })().then(function() {
        
        if (pushError.isConflict()) {
            if (pushHandler && pushHandler.onConflict) {
                // NOTE: value of server record will not be available in case of 409.
                return pushHandler.onConflict(pushError);
            }
        } else if (pushHandler && pushHandler.onError) {
            return pushHandler.onError(pushError);
        }

    }).then(undefined, function(error) {
        // Set isHandled to false even if the user has set it to handled if the onConflict / onError failed 
        pushError.isHandled = false;
    });
}
function handlePushError ( pushError , pushHandler ) { return Platform . async ( function ( callback ) { callback ( ) ; } ) ( ) . then ( function ( ) { if ( pushError . isConflict ( ) ) { if ( pushHandler && pushHandler . onConflict ) { // NOTE: value of server record will not be available in case of 409. return pushHandler . onConflict ( pushError ) ; } } else if ( pushHandler && pushHandler . onError ) { return pushHandler . onError ( pushError ) ; } } ) . then ( undefined , function ( error ) { // Set isHandled to false even if the user has set it to handled if the onConflict / onError failed  pushError . isHandled = false ; } ) ; }
Attempts error handling by delegating it to the user, if a push handler is provided
@private
Attempts error handling by delegating it to the user if a push handler is provided