Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
Realm JS Try...Catch block returns both error and success promises

When the code below is executed with the correct values, the object is deleted and the function returns both "Success" and "Error: object must be of type 'object', got (undefined)". So, the function is working because it deletes the object, but I shouldn't be getting any error message.

this.del = async function (arg1, arg2) {
    openR = openRealm(arg1);
    const realm = await Realm.open(openR);
    try {
    realm.write(() => {
    const del = realm.objectForPrimaryKey(openR.schema[0].name, arg2);
    realm.delete(del);
    });
    } catch(e) {
    return Promise.resolve(e);
}   
    return Promise.resolve("Success");  
    }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The problem isn't with the code. It's just React Native reloading the component after the promise is resolved, and so calling the function again.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda