AddDoc error not being caught
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- angular, firebase, typescript
- Domínio
- databases
Direção de pesquisa
Comece pelo ponto de entrada saveProjectTest e pela sua chamada await addDoc, usando as versões fornecidas do AngularFire e do emulador do Firestore. Reproduza o caso com o contêiner do Firebase parado, compare a falha de addDoc com o throw explícito e verifique se o erro esperado chega ao bloco catch.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Good morning.
In our project, I've been trying to handle the output of an addDoc call using angular/fire. The exception will get caught but not the error thrown by addDoc. When uncommenting the line //throw "patata" the catch block will get executed.
async saveProjectTest(projectTracking: ProjectTracking) {
const projectTrackingsRef = collection(this.firestore, 'projecttrackings');
try{
console.log("here1");
//throw "patata";
await addDoc(projectTrackingsRef, projectTracking);
console.log("here2");
}catch(error){
console.log("caught");
};
}
I don't know if it is a bug or what it is, but this is specially important since it seems like the appropriate way to handle connection errors and any other kinds of errors in my app. Right now I can only implement the "happy path".
I'm using Chromium v130, angularfire 18.0.1, with Angular 18.1.3, connecting to a docker container running a firebase emulator. When I want to test no connectivity, I take down the firebase container.
Thanks in advance, appreciate your help.
- Linguagem predominante
- TypeScript
- Estrelas
- 7.8k
- Forks
- 2.2k
- Merge médio
- 3d 6h
- PRs com merge (30d)
- 5
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/angularfire
-
comp: build/pipeline type: bug version: current (v17+)
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
angular/angularfire#3766 ·
-
comp: schematics type: bug version: current (v17+)
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
angular/angularfire#3768 ·
-
comp: docs type: chore version: current (v17+)
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 58/100
angular/angularfire#3764 ·
-
comp: firestore comp: ssr priority: P0 (critical) type: feature version: current (v17+)
angular/angularfire#3757 · 1 responsável ·
-
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachable Abertacomp: core type: feature
angular/angularfire#3755 · 1 responsável ·
Todas as issues de angular/angularfire
Issues semelhantes
-
blocklist removal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
pastelsky/bundlephobia#1122 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100