1602 / 1602/jugglingdb

Gracefully handling connections errors...

Abierto
#405 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
2k
Forks
238
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Maybe I'm missing something, but since the instantiation of the Schema class automatically does the connect behind the scenes without a callback, there is no way to gracefully handle connection errors.

Most other ORMs seem to provide a connect function with a callback that passes back an err object, as is the case when you perform a find operation with JugglingDB. If for some reason the server is unable to connect I want to gracefully handle the error and not kill the process. I could use Node's domains to catch the error, but it would be so much simpler to just have a callback. I see there is an event emitted when JugglingDB has connected, but other than that, what am I supposed to do? I rather like the this ORM (minus the thorough documentation), but this seems like a simple thing thats missing?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Look at the Schema class instantiation code to see where the connection is made. Identify how other ORMs handle connection errors with callbacks. Check for existing connection events in the codebase. The goal is to add a callback parameter or event listener for connection errors without breaking existing functionality.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, nodejs
Área
backend, databases
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.