Skip to content

Problem to throw firestore error when Emulators is down #6924

@molavec

Description

@molavec

[REQUIRED] Describe your environment

  • Operating System version: macOS 12.6 - BuildVersion: 21G115
  • Browser version: Versión 108.0.5359.124 (Build oficial) (x86_64)
  • Firebase SDK version: 9.15.0
  • Firebase Product: Firestore

[REQUIRED] Describe the problem

When trying to force an error, shutting down de emulator, instead throw error the API just print error in console. It doesn't permit execution of proper action in the code to manage error in UI.

Steps to reproduce:

  1. Stop Emulators
  2. Make a call to create a new document.
  3. Check catch and console logs.

image

Relevant Code:

const createParameter = async (parameter: ParameterType) => {
  try {
    console.log('Inside createParameter');
    const docRef = await addDoc(collection(db, 'parameters'), parameter);
    console.log('after addDoc');
    console.log("Document written with ID: ", docRef.id);
    parameter.id = docRef.id;
    return parameter;
  } catch (error) {
    console.log('ERROR: DATABASE CONNECTION', error);
    throw error;
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions