I am struggling with this code and need help identifying how to capture errors.
const dataRef = database.ref('test');
dataRef.on('value', snapshot => {
snapshot.val();
});
Does anyone have any suggestions on how I can approach this issue?