+
+
+[Yoni Goldberg](https://github.com/goldbergyoni)
+
+
+[Josh Hemphill](https://github.com/josh-hemphill)
+
+
+[Raz Luvaton](https://github.com/rluvaton)
+
+
+[Kyle Martin](https://github.com/js-kyle)
+
+
+[Kevyn Bruyere](https://github.com/kevynb)
+
+
+[Sagir Khan](https://github.com/sagirk)
+
+
+
[Yoni Goldberg](https://github.com/goldbergyoni)
+
[Bruno Scheufler](https://github.com/BrunoScheufler)
+
[Kyle Martin](https://github.com/js-kyle)
+
[Kevyn Bruyere](https://github.com/kevynb)
+
[Sagir Khan](https://github.com/sagirk)
|
|
+|
|
|
| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
| [Ido Richter (Fundatzailea)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) |
### Emeriti Kolaboratzailea
-|
|
+|
|
| :-------------------------------------------------------------------------------------------------------------------------: |
| [Refael Ackermann](https://github.com/refack) |
@@ -1382,175 +1377,256 @@ Eskerrik asko proiektu honetan parte hartu duten pertsona zoragarriei!
+
+
[Yoni Goldberg](https://github.com/goldbergyoni)
+
[Bruno Scheufler](https://github.com/BrunoScheufler)
+
[Kyle Martin](https://github.com/js-kyle)
+
[Sagir Khan](https://github.com/sagirk)
|
|
+|
|
|
| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) |
### Colaboradores anteriores
-|
|
+|
|
| :-------------------------------------------------------------------------------------------------------------------------: |
| [Refael Ackermann](https://github.com/refack) |
@@ -1122,6 +1167,6 @@ Nossos colaboradores são membros que estão contribuindo com o repositório em
## Thank You Notes
-We appreciate any contribution, from a single word fix to a new best practice. View our contributors and [contributing documentation here!](CONTRIBUTORS.md)
+We appreciate any contribution, from a single word fix to a new best practice. View our contributors and [contributing documentation here!](./README.md#contributors-)
1. 项目结构实践4. 测试和总体的质量实践5. 上线实践
+⬆ Retourner en haut de la page
+ +# `2. Gestion des erreurs` + +## ![✔] 2.1 Utilisez Async-Await ou les promesses pour le traitement des erreurs asynchrones + +**TL;PL :** Gérer les erreurs asynchrone avec le style fonction de rappel est probablement le chemin le plus rapide vers l'enfer (ou la [pyramide condamnée](https://fr.wikipedia.org/wiki/Pyramide_condamn%C3%A9e)). Le meilleur cadeau que vous puissiez faire à votre code est d'utiliser une bibliothèque de promesses réputée ou async-await à la place, ceci permet une syntaxe de code beaucoup plus compacte et familière comme try-catch. + +**Autrement :** Le style fonction de rappel de Node.js, function(err, response), constituent une autre manière d’obtenir une solution non maintenable mêlant gestion de l’erreur avec du code ordinaire, des imbrications excessives et une conception bancale. + +🔗 [**Plus d'infos : évitez les fonctions de rappel**](./sections/errorhandling/asyncerrorhandling.french.md) + +⬆ Retourner en haut de la page
+ +# `3. Style du code` + +## ![✔] 3.1 Utilisez ESLint + +**TL;PL :** [ESLint](https://eslint.org) est la norme de facto pour vérifier d'éventuelles erreurs de code et pour corriger le style du code, ce n'est pas uniquement pour identifier les problèmes d'espacement mais aussi pour détecter les antipatterns préoccupants du code comme par exemple les développeurs levant des erreurs sans classification. Bien qu'ESLint puisse corriger automatiquement les styles du code, d'autres outils comme [prettier](https://www.npmjs.com/package/prettier) et [beautify](https://www.npmjs.com/package/js-beautify) sont plus puissants dans le formatage de la correction et fonctionnent en collaboration avec ESLint. + +**Autrement :** Les développeurs se concentreront sur les problèmes fastidieux d'espacement et de largeur de ligne, ce qui pourrait faire perdre du temps à trop réfléchir sur le style de code du projet. + +🔗 [**Plus d'infos : Utilisez ESLint et Prettier**](./sections/codestylepractices/eslint_prettier.french.md) + +⬆ Retourner en haut de la page
+ +# `4. Tests et pratiques générales de qualité` + +## ![✔] 4.1 Au minimum, écrivez des tests API (pour chaque composant) + +**TL;PL :** La plupart des projets n'ont tout simplement pas de test automatisé en raison de délais courts ou souvent le « projet de test » est devenu incontrôlable et a été abandonné. Pour cette raison, priorisez et commencez par les tests d'API, qui est le moyen le plus simple d'écrire et qui offre plus de couverture que les tests unitaires (vous pouvez même créer des tests d'API sans code à l'aide d'outils comme [Postman](https://www.getpostman.com/)). Par la suite, si vous avez plus de ressources et de temps, continuez avec des types de tests avancés tels que les tests unitaires, les tests DB (base de données), les tests de performances, etc. + +**Autrement :** Vous pouvez passer de longues journées à écrire des tests unitaires pour découvrir que vous n'avez qu'une couverture système de 20% + +⬆ Retourner en haut de la page
+ +# `5. Pratiques de mise en production` + +## ![✔] 5.1. Surveillance + +**TL;PL :** La surveillance est un jeu qui consiste à découvrir les problèmes avant que les clients ne les trouvent - il est évident qu'il faut accorder une importance sans précédent à cette question. Le marché est submergé d'offres, pensez donc à commencer par définir les mesures de base que vous devez suivre (mes suggestions à l'intérieur), puis passez en revue les fonctionnalités supplémentaires et choisissez la solution qui coche toutes les cases. Cliquez sur « l'essentiel » ci-dessous pour un aperçu des solutions. + +**Autrement :** Échec === clients déçus. C'est simple. + +🔗 [**Plus d'infos : surveillance !**](./sections/production/monitoring.french.md) + +⬆ Retourner en haut de la page
+ +# `6. Bonnes pratiques de sécurité` + +⬆ Retourner en haut de la page
+ +# `7. Brouillon : Bonnes pratiques de performance` + +## Nos contributeurs travaillent sur cette section. [Voulez-vous nous rejoindre ?](https://github.com/goldbergyoni/nodebestpractices/issues/256) + +⬆ Retourner en haut de la page
+ +# `8. Bonnes pratiques de Docker` + +🏅 Un grand merci à [Bret Fisher](https://github.com/BretFisher) de qui nous avons appris plusieurs des pratiques suivantes + +
+
+[Yoni Goldberg](https://github.com/goldbergyoni)
+
+
+[Bruno Scheufler](https://github.com/BrunoScheufler)
+
+
+[Kyle Martin](https://github.com/js-kyle)
+
+
+[Kevyn Bruyere](https://github.com/kevynb)
+
+
+[Sagir Khan](https://github.com/sagirk)
+
|
|
|
|
+| :--: | :--: | :--: | :--: |
+| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) | [Raz Luvaton](https://github.com/rluvaton) | [Josh Hemphill](https://github.com/josh-hemphill) |
+
+### Collaborateur émérite
+
+|
|
+| :-------------------------------------------------------------------------------------------------------------------------: |
+| [Refael Ackermann](https://github.com/refack) |
+
+
+
+
+[Yoni Goldberg](https://github.com/goldbergyoni)
+
+
+[Josh Hemphill](https://github.com/josh-hemphill)
+
+
+[Raz Luvaton](https://github.com/rluvaton)
+
+
+[Kyle Martin](https://github.com/js-kyle)
+
+
+[Kevyn Bruyere](https://github.com/kevynb)
+
+
+[Sagir Khan](https://github.com/sagirk)
+
+
+
[Yoni Goldberg](https://github.com/goldbergyoni)
+
[Bruno Scheufler](https://github.com/BrunoScheufler)
+
[Kyle Martin](https://github.com/js-kyle)
+
[Kevyn Bruyere](https://github.com/kevynb)
+
[Sagir Khan](https://github.com/sagirk)
|
|
+|
|
|
| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) |
### Mantan Kolaborator
-|
|
+|
|
| :-------------------------------------------------------------------------------------------------------------------------: |
| [Refael Ackermann](https://github.com/refack) |
@@ -1375,181 +1376,256 @@ Terima kasih kepada orang-orang hebat ini yang telah berkontribusi pada reposito
+
+
[Yoni Goldberg](https://github.com/goldbergyoni)
+
[Bruno Scheufler](https://github.com/BrunoScheufler)
+
[Kyle Martin](https://github.com/js-kyle)
+
[Kevyn Bruyere](https://github.com/kevynb)
+
[Sagir Khan](https://github.com/sagirk)
|
|
+|
|
|
| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) |
### コラボレーター・エメリティ
-|
|
+|
|
| :-------------------------------------------------------------------------------------------------------------------------: |
| [Refael Ackermann](https://github.com/refack) |
+
+
[요니 골드버그](https://github.com/goldbergyoni)
+
[브루노 슈플러](https://github.com/BrunoScheufler)
+
[카일 마틴](https://github.com/js-kyle)
+
[사기르 칸](https://github.com/sagirk)
|
|
|
-| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
-| [이도 릭터 (창립주)](https://github.com/idori) | [키스 홀리데이](https://github.com/TheHollidayInn) | [케빈 브뤼예르](https://github.com/kevynb) |
+|
|
|
|
+| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: |
+| [이도 릭터 (창립주)](https://github.com/idori) | [키스 홀리데이](https://github.com/TheHollidayInn) | [케빈 브뤼예르](https://github.com/kevynb) |
### 전 공동 저자
-|
|
+|
|
| :-------------------------------------------------------------------------------------------------------------------------: |
| [Refael Ackermann](https://github.com/refack) |
+
+
[Yoni Goldberg](https://github.com/goldbergyoni)
-
+
-[Bruno Scheufler](https://github.com/BrunoScheufler)
-
+
-[Kyle Martin](https://github.com/js-kyle)
-
-
-[Kevyn Bruyere](https://github.com/kevynb)
-
+
+
+
+
|
|
-| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
-| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) |
+
-### Collaborator Emeriti
+[Kyle Martin](https://github.com/js-kyle)
+
|
-| :-------------------------------------------------------------------------------------------------------------------------: |
-| [Refael Ackermann](https://github.com/refack) |
+Full Stack Developer & Site Reliability Engineer based in New Zealand, interested in web application security, and architecting and building Node.js applications to perform at global scale.
-If you've ever wanted to contribute to open source, now is your chance! See the [contributing docs](.operations/CONTRIBUTING.md) for more information.
+[Kevyn Bruyere](https://github.com/kevynb)
+
-
-
+[Sagir Khan](https://github.com/sagirk)
+
+
+
[Yoni Goldberg](https://github.com/goldbergyoni)
+
[Bruno Scheufler](https://github.com/BrunoScheufler)
+
[Kyle Martin](https://github.com/js-kyle)
+
[Sagir Khan](https://github.com/sagirk)
|
|
+|
|
|
| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) |
### Wcześniejsza współpraca
-|
|
+|
|
| :-------------------------------------------------------------------------------------------------------------------------: |
| [Refael Ackermann](https://github.com/refack) |
@@ -1143,5 +1144,5 @@ Nasi współpracownicy są członkami, którzy regularnie współuczestniczą w
## Dziękujemy za uwagi
-Doceniamy każdy wkład, od poprawki pojedynczego słowa, po nową najlepszą praktykę. Zobacz naszych autorów i [dokumentację CONTRIBUTORS tutaj!](CONTRIBUTORS.md)
+Doceniamy każdy wkład, od poprawki pojedynczego słowa, po nową najlepszą praktykę. Zobacz naszych autorów i [dokumentację CONTRIBUTORS tutaj!](./README.md#contributors-)
+
+
[Yoni Goldberg](https://github.com/goldbergyoni)
+
[Bruno Scheufler](https://github.com/BrunoScheufler)
+
[Kyle Martin](https://github.com/js-kyle)
+
[Sagir Khan](https://github.com/sagirk)
|
|
+|
|
|
| :---------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
| [Ido Richter (Founder)](https://github.com/idori) | [Keith Holliday](https://github.com/TheHollidayInn) |
### Прошлые соавторы
-|
|
+|
|
| :-------------------------------------------------------------------------------------------------------------------------: |
| [Refael Ackermann](https://github.com/refack) |
@@ -1158,6 +1159,6 @@ null == undefined; // true
## Благодарности
-Мы ценим любой вклад, от одного исправленного слова до новой лучшей практики. Список участников и [документация по поддержке тут!](CONTRIBUTORS.md)
+Мы ценим любой вклад, от одного исправленного слова до новой лучшей практики. Список участников и [документация по поддержке тут!](./README.md#contributors-)
+
+
+
Use async-await for async error handling
+##
Use async-await for async error handling
**TL;DR:** Handling async errors in callback style is probably the fastest way to hell (a.k.a the pyramid of doom). The best gift you can give to your code is using instead a reputable promise library or async-await which provides much compact and familiar code syntax like try-catch
**Otherwise:** Node.js callback style, function(err, response), is a promising way to un-maintainable code due to the mix of error handling with casual code, excessive nesting and awkward coding patterns
-🔗 [**Use async-await for async error handling**](/sections/errorhandling/asyncawait.md)
+🔗 [**Use async-await for async error handling**](../errorhandling/asyncerrorhandling.md)
Use async-await for async error handling
+##
Use async-await for async error handling
**TL;DR:** Handling async errors in callback style is probably the fastest way to hell (a.k.a the pyramid of doom). The best gift you can give to your code is using instead a reputable promise library or async-await which provides much compact and familiar code syntax like try-catch
**Otherwise:** Node.js callback style, function(err, response), is a promising way to un-maintainable code due to the mix of error handling with casual code, excessive nesting and awkward coding patterns
-🔗 [**Use async-await for async error handling**](/sections/errorhandling/asyncawait.md)
+🔗 [**Use async-await for async error handling**](../errorhandling/asyncerrorhandling.md)
diff --git a/sections/errorhandling/apmproducts.basque.md b/sections/errorhandling/apmproducts.basque.md
index 50b8642ab..0ea3a2126 100644
--- a/sections/errorhandling/apmproducts.basque.md
+++ b/sections/errorhandling/apmproducts.basque.md
@@ -1,12 +1,12 @@
# Aurkitu erroreak eta jardunik gabeko uneak APM produktuak erabiliz
-### Azalpen paragrafoa
+### Azalpena
-Salbuespena != Errorea. Erroreen kudeaketa tradizionalak kodearekin erlazionatutako arazotzat hartzen ditu salbuespenak, baina aplikazioen erroreak formularioko kode bide motelen, APIen jardunik gabeko uneen eta baliabide konputazionalen gabezien ondorio izan daitezke. Horra non APM produktuak oso erabilgarriak diren, 'lurperatutako' askotariko gaiak modu proaktiboan detektatzeko aukera ematen baitute gutxieneko konfigurazioarekin. APM produktuen ohiko funtzionalitateen artean daude, adibidez, HTTP APIak erroreak bidaltzen dituenean alerta jotzea, APIaren erantzunaren denbora aurretik zehaztutako denbora muga baino luzeagoa denean antzematea, ‘kode usainak’ hautematea, monitorizazio zerbitzariaren baliabideentzako funtzionalitateak, operazio inteligentziadun panelak (dashboard) IT metrikekin eta beste funtzionalitate batzuk oso erabilgarriak direnak. Hornitzaile gehienek dohaineko plana eskaintzen dute.
+Salbuespena != Errorea. Erroreen kudeaketa tradizionalak kodearekin erlazionatutako arazotzat hartzen ditu salbuespenak, baina aplikazioen erroreak formularioko kode bide motelen, APIen jardunik gabeko uneen eta baliabide konputazionalen gabezien ondorio izan daitezke. Horra non APM produktuak oso erabilgarriak diren, "lurperatutako" askotariko gaiak modu proaktiboan detektatzeko aukera ematen baitute gutxieneko konfigurazioarekin. APM produktuen ohiko funtzionalitateen artean daude, adibidez, HTTP APIak erroreak bidaltzen dituenean alerta jotzea, APIaren erantzunaren denbora aurretik zehaztutako denbora muga baino luzeagoa denean antzematea, ‘kode usainak’ hautematea, monitorizazio zerbitzariaren baliabideentzako funtzionalitateak, operazio inteligentziadun panelak (dashboard) IT metrikekin eta beste funtzionalitate batzuk oso erabilgarriak direnak. Hornitzaile gehienek dohaineko plana eskaintzen dute
### Wikipedia APMri buruz
-Informazioaren teknologien eta sistemen kudeaketaren alorretan, Application Performance Management (APM) software aplikazioen errendimendu eta erabilgarritasunaren monitorizazio eta kudeaketa da. APM aplikazioen errendimendu arazo konplexuak atzeman eta diagnostikatzen saiatzen da, esperotako zerbitzu maila mantentzeko. APM "IT metrikak negozioaren esanahira ([hau da,] balioa)" itzultzea da. Produktu eta segmentu nagusiak. APM "IT metrikak negozioaren esanahira ([hau da,] balioa)" itzultzea da. Produktu eta segmentu nagusiak.
+Informazioaren teknologien eta sistemen kudeaketaren alorretan, Application Performance Management (APM) software aplikazioen errendimendu eta erabilgarritasunaren monitorizazio eta kudeaketa da. APM aplikazioen errendimendu arazo konplexuak atzeman eta diagnostikatzen saiatzen da, esperotako zerbitzu maila mantentzeko. APM "IT metrikak negozioaren esanahira ([esaterako] balioa)" itzultzea da. Produktu eta segmentu nagusiak. APM "IT metrikak negozioaren esanahira ([esaterako] balioa)" itzultzea da. Produktu eta segmentu nagusiak
### APM merkatua ulertzen
@@ -14,14 +14,14 @@ APM produktuek 3 segmentu nagusi dituzte:
1. Webgune edo APIen monitorizazioa, martxan egondako denbora eta errendimuendua HTTP eskaeren bidez etengabe monitorizatzen dituzten kanpo zerbitzuak. Minutu gutxi batzuetan ezar daiteke. Hurrengo hauek dira aukeratutako lehiakide batzuk: [Pingdom](https://www.pingdom.com/), [Uptime Robot](https://uptimerobot.com/), eta [New Relic](https://newrelic.com/application-monitoring)
-2. Kodearen instrumentazioa, kode motelaren atzematea, salbuespenen estadistikak, errendimenduaren monitorizazioa eta holako beste funtzionalitate batzuk erabiltzeko agente bat aplikazioan txertatzea eskatzen duen produktu familia da. Hurrengo hauek dira aukeratutako lehiakide batzuk: New Relic, App Dynamics
+2. Kodearen instrumentazioa, kode motelaren atzematea, salbuespenen estatistikak, errendimenduaren monitorizazioa eta holako beste funtzionalitate batzuk erabiltzeko agente bat aplikazioan txertatzea eskatzen duen produktu familia da. Hurrengo hauek dira aukeratutako lehiakide batzuk: New Relic, App Dynamics
-3. Adimen operatiboaren panela produktuen linea bat da, operazio taldeari metrika eta eduki aukeratuak eskaintzen dizkiona eta aplikazioaren errendimendua zein den jakitera behartzen duena. Horrek informazio iturri anitz (aplikazioen erregistroak, DB erregistroak, zerbitzarien erregistroa, etab.) eta aurrez aurreko arbelaren diseinua batzea eskatzen du. Hurrengo hauek dira aukeratutako lehiakide batzuk: [Datadog](https://www.datadoghq.com/), [Splunk](https://www.splunk.com/), [Zabbix](https://www.zabbix.com/)
+3. Adimen operatiboaren panela produktuen linea bat da, operazio taldeari metrika eta eduki aukeratuak eskaintzen dizkiona eta aplikazioaren errendimendua zein den jakitera behartzen duena. Horrek informazio iturri anitz (aplikazioen erregistroak, DB erregistroak, zerbitzarien erregistroa, etab.) eta aurrez aurreko arbelaren diseinua batzea eskatzen du. Hurrengo hauek dira aukeratutako lehiakide batzuk: [Datadog](https://www.datadoghq.com/), [Splunk](https://www.splunk.com/), [Zabbix](https://www.zabbix.com/)
### Adibidea: UpTimeRobot.Com: webguneak monitorizatzeko panela
-
+
### Adibidea: AppDynamics.Com: hasieratik amaierarainoko monitorizazioa kode instrumentazioarekin konbinatutakoa
-
+
diff --git a/sections/errorhandling/apmproducts.brazilian-portuguese.md b/sections/errorhandling/apmproducts.brazilian-portuguese.md
index 1e7b824cb..459e50f10 100644
--- a/sections/errorhandling/apmproducts.brazilian-portuguese.md
+++ b/sections/errorhandling/apmproducts.brazilian-portuguese.md
@@ -22,7 +22,7 @@ Os produtos APM constituem 3 segmentos principais:
### Exemplo: UpTimeRobot.Com - Painel de monitoramento de site
-
+
### Example: AppDynamics.Com – monitoramento de ponta a ponta combinado com instrumentação de código
-
+
diff --git a/sections/errorhandling/apmproducts.chinese.md b/sections/errorhandling/apmproducts.chinese.md
index 8803f2791..0777b7359 100644
--- a/sections/errorhandling/apmproducts.chinese.md
+++ b/sections/errorhandling/apmproducts.chinese.md
@@ -21,7 +21,7 @@ APM 产品由3个主要部分构成:
### 示例: UpTimeRobot.Com – 网站监控仪表板
-
+
### 示例: AppDynamics.Com – 与代码检测结合的端到端监视
-
+
diff --git a/sections/errorhandling/apmproducts.french.md b/sections/errorhandling/apmproducts.french.md
new file mode 100644
index 000000000..bfe5f5916
--- /dev/null
+++ b/sections/errorhandling/apmproducts.french.md
@@ -0,0 +1,28 @@
+# Découvrez les erreurs et les indisponibilités à l'aide des produits de gestion de la performance applicative
+
+
+### Un paragraphe d'explication
+
+Exception != Erreur. Le traitement traditionnel des erreurs suppose l'existence d'une exception en raison d'un problème lié au code, mais les erreurs d'application peuvent se présenter sous la forme de parcours de code lents, d'indisponibilité de l'API, de manque de ressources de calcul, etc. C’est là que les produits de gestion de la performance applicative (En anglais Application Performance Management : APM) sont utiles car ils permettent de détecter de manière proactive une grande variété de problèmes « cachés » avec une configuration minimale. Parmi les caractéristiques communes des produits APM, on trouve par exemple les alertes lorsque l'API HTTP renvoie des erreurs, la détection lorsque le temps de réponse de l'API tombe en dessous d'un certain seuil, la détection des « [codes smells](https://fr.wikipedia.org/wiki/Code_smell) », les fonctionnalités de surveillance des ressources du serveur, le tableau de bord de l'intelligence opérationnelle avec des mesures informatiques et plusieurs autres fonctionnalités utiles. La plupart des fournisseurs proposent un forfait gratuit.
+
+### APM sur Wikipédia
+
+Dans les domaines des technologies de l'information et de la gestion des systèmes, « Application Performance Management » (APM) est la surveillance et la gestion des performances et de la disponibilité des applications logicielles. APM s'efforce de détecter et de diagnostiquer les problèmes de performances des applications complexes pour maintenir un niveau de service souhaité. APM est « la traduction des métriques informatiques en signification métier (c'est-à-dire en valeur) ».
+
+### Comprendre le marché APM
+
+Les produits APM regroupent 3 pôles principaux :
+
+1. Surveillance de site Web ou d'API - services externes qui surveillent constamment la disponibilité et les performances via des requêtes HTTP. Peut être installé en quelques minutes. Voici quelques candidats sélectionnés : [Pingdom](https://www.pingdom.com/), [Uptime Robot](https://uptimerobot.com/) et [New Relic](https://newrelic.com/application-monitoring).
+
+2. Instrumentation de code - famille de produits qui nécessite d'incorporer un agent dans l'application pour utiliser les fonctionnalités telles que la détection de code lent, les statistiques d'exception, la surveillance des performances et bien d'autres. Voici quelques candidats sélectionnés : New Relic, App Dynamics.
+
+3. Tableau de bord de l'intelligence opérationnelle - cette gamme de produits vise à faciliter la tâche de l'équipe d'exploitation avec des mesures et un contenu organisé qui permettent de rester facilement au fait de la performance des applications. Cela implique généralement l'agrégation de plusieurs sources d'informations (journaux d'application, journaux de base de données, journaux des serveurs, etc.) et le travail de conception du tableau de bord initial. Voici quelques candidats sélectionnés : [Datadog](https://www.datadoghq.com/), [Splunk](https://www.splunk.com/), [Zabbix](https://www.zabbix.com/).
+
+
+
+ ### Exemple : UpTimeRobot.Com - Tableau de bord de surveillance de site Web
+
+
+ ### Exemple : AppDynamics.Com - Surveillance de bout en bout combinée à une instrumentation de code
+
diff --git a/sections/errorhandling/apmproducts.japanese.md b/sections/errorhandling/apmproducts.japanese.md
index 34370867c..5e8b56f80 100644
--- a/sections/errorhandling/apmproducts.japanese.md
+++ b/sections/errorhandling/apmproducts.japanese.md
@@ -22,7 +22,7 @@ APM 製品は 3 つの主要なセグメントを構成しています:
### 例: UpTimeRobot.Com – ウェブサイトモニタリングダッシュボード
-
+
### 例: AppDynamics.Com – コード計測が統合されたエンドツーエンドモニタリング
-
+
diff --git a/sections/errorhandling/apmproducts.korean.md b/sections/errorhandling/apmproducts.korean.md
index ad5081797..fd4ae438e 100644
--- a/sections/errorhandling/apmproducts.korean.md
+++ b/sections/errorhandling/apmproducts.korean.md
@@ -22,7 +22,7 @@ APM products constitute 3 major segments:
### Example: UpTimeRobot.Com – Website monitoring dashboard
-
+
### Example: AppDynamics.Com – end to end monitoring combined with code instrumentation
-
+
diff --git a/sections/errorhandling/apmproducts.md b/sections/errorhandling/apmproducts.md
index 5f302168d..ae6fc82ec 100644
--- a/sections/errorhandling/apmproducts.md
+++ b/sections/errorhandling/apmproducts.md
@@ -22,7 +22,7 @@ APM products constitute 3 major segments:
### Example: UpTimeRobot.Com – Website monitoring dashboard
-
+
### Example: AppDynamics.Com – end to end monitoring combined with code instrumentation
-
+
diff --git a/sections/errorhandling/apmproducts.polish.md b/sections/errorhandling/apmproducts.polish.md
index a53a4b176..2a10799a8 100644
--- a/sections/errorhandling/apmproducts.polish.md
+++ b/sections/errorhandling/apmproducts.polish.md
@@ -22,7 +22,7 @@ Produkty APM stanowią 3 główne segmenty:
### Przykład: UpTimeRobot.Com – Website monitoring dashboard
-
+
### Przykład: AppDynamics.Com – end to end monitoring combined with code instrumentation
-
+
diff --git a/sections/errorhandling/apmproducts.russian.md b/sections/errorhandling/apmproducts.russian.md
index 242b6786c..e4c23d814 100644
--- a/sections/errorhandling/apmproducts.russian.md
+++ b/sections/errorhandling/apmproducts.russian.md
@@ -22,7 +22,7 @@
### Пример: UpTimeRobot.Com - панель мониторинга сайта
-
+
### Пример: AppDynamics.Com – сквозной мониторинг в сочетании с инструментарием кода
-
+
diff --git a/sections/errorhandling/asyncerrorhandling.basque.md b/sections/errorhandling/asyncerrorhandling.basque.md
index 790fd139e..0ae082ac9 100644
--- a/sections/errorhandling/asyncerrorhandling.basque.md
+++ b/sections/errorhandling/asyncerrorhandling.basque.md
@@ -1,8 +1,8 @@
# Erabili Async-Await edo errore asinkronoak kudeatzeko promesak
-### Azalpen paragrafoa
+### Azalpena
-Callbackak ez dira kudea errazak programatzaile gehienek ez dituzte ondo ezagutzen eta. Callbackek etengabeko errore egiaztatzea eskatzen dute, kode korapilotsua jasanaraziz eta kodigoaren fluxuaren ulergarritasuna zailduz. BlueBird, async, eta Q bezalako promesa liburutegiek kodigo estilo estandarra RETURN eta THROW erabiliz paketatzen dute, programaren fluxua kontrolatzeko. Zehazki, kodigo nagusia funtzio bakoitzean erroreak kuadeatzetik askatzea ahalbidetzen duen try-catch errore kudeaketa estilo gogokoena onartzen dute
+Callbackak ez dira kudea errazak programatzaile gehienek ez dituzte ondo ezagutzen eta. Callbackek etengabeko errore egiaztatzea eskatzen dute, kode korapilotsua jasanaraziz eta kodigoaren fluxuaren ulergarritasuna zailduz. BlueBird, async, eta Q bezalako promesa liburutegiek kodigo estilo estandarra RETURN eta THROW erabiliz paketatzen dute, programaren fluxua kontrolatzeko. Zehazki, kodigo nagusia funtzio bakoitzean erroreak kudeatzetik askatzea ahalbidetzen duen try-catch errore kudeaketa estilo gogokoena onartzen dute
### Kode adibidea: promesen erabilera erroreak antzemateko
@@ -93,27 +93,26 @@ datuakEskuratu(
@@ -229,31 +229,31 @@ Zero kostuko pila aztarna asinkronoak" deitzen den v8 funtzionalitate bat
## Azalpen aurreratua
-Oso ezberdinak dira funtzio sinkronoen pila aztarnen eta funtzio asinkronoen pila aztarnen mekanismoak v8ren ezarpenetan: pila aztarna asinkronoa oinarritua dago Node.js martxan dagoen sistema eragileak emandako **pila**n (programazio lengoaia gehienak bezala). Funtzio asinkrono bat exekutatzen ari denean, sistema eragileko **pila** agerian jartzen da funtzioa bere lehen `await`era iristen den momentuan. Beraz, pilaren aztarna nahasketa bat da, hain zuzen, sistema eragilearen pilaren eta baztertutako **promesa ebazpen katea**rena. Zero kostuko pila aztarna asinkronoen ezarpenak **promesa ebazpen katea** luzatzen du bakarrik promesa `itxaroten` [¹](#1) ari den bitartean. Funtzio asinkronoek bakarrik (`async`) itxaron (`await`) ahal dutenez, beti galduko da funtzio asinkronoa pilaren aztarna asinkrono batean, operazio asinkronoren bat izan bada funtzioa deitu eta gero [²](#2)
+Oso ezberdinak dira funtzio sinkronoen pila aztarnen eta funtzio asinkronoen pila aztarnen mekanismoak v8ren ezarpenetan: pila aztarna asinkronoa oinarritua dago Node.js martxan dagoen sistema eragileak emandako **pila**n (programazio lengoaia gehienak bezala). Funtzio asinkrono bat exekutatzen ari denean, sistema eragileko **pila** agerian jartzen da funtzioa bere lehen `await`era iristen den momentuan. Beraz, pilaren aztarna nahasketa bat da, hain zuzen, sistema eragilearen pilaren eta baztertutako **promesa ebazpen katea**rena. Zero kostuko pila aztarna asinkronoen ezarpenak **promesaren ebazpen katea** luzatzen du bakarrik promesa `itxaroten` [¹](#1) ari den bitartean. Funtzio asinkronoek bakarrik (`async`) itxaron (`await`) ahal dutenez, beti galduko da funtzio asinkronoa pilaren aztarna asinkrono batean, operazio asinkronoren bat izan bada funtzioa deitu eta gero [²](#2)
-### The tradeoff (sektorea)
+### Erdibidea
-`await` bakoitzak mikro ataza berri bat sortzen du gertaeraren begiztan. Beraz `await` gehiago gehitzeak errendimendu zigorra ekarriko luke. Hala ere, sareak edota datu baseak sortutako errendimendu isuna [ikaragarri handiagoa](https://colin-scott.github.io/personal_website/research/interactive_latency.html) da, eta, beraz gehitutako `await`aren zigorra ez da zerbitzariak edo CLIak garatzeko orduan kontutan hartu beharreko zerbait, eskaera edo komando bakoitzeko oso kode beroa izan ezean behintzat. Orduan, `await` ezabatzeak `return await`etan errendimendu bultzada nabarmena bilatzeko azken lekua izan beharko luke eta, zalantzarik gabe, inoiz ez litzateke aldez aurretik egin beharko
+`await` bakoitzak mikro ataza berri bat sortzen du gertaeraren begiztan. Beraz, `await` gehiago gehitzeak errendimendu zigorra ekarriko luke. Hala ere, sareak edota datu baseak sortutako errendimendu isuna [ikaragarri handiagoa](https://colin-scott.github.io/personal_website/research/interactive_latency.html) da, eta, beraz, gehitutako `await`aren zigorra ez da zerbitzariak edo CLIak garatzeko orduan kontutan hartu beharreko zerbait, eskaera edo komando bakoitzeko oso kode beroa izan ezean behintzat. Orduan, `await`ak ezabatzeak `return await`etan errendimendu bultzada nabarmena bilatzeko azken lekua izan beharko luke eta, zalantzarik gabe, inoiz ez litzateke aldez aurretik egin beharko
### Zergatik jotzen zen await bueltatzea anti eredutzat iraganean
-[Artikulu bikain](https://jakearchibald.com/2017/await-vs-return-vs-return-await/) ugari daude azaltzen dutenak zergatik `return await`ak ez diren inoiz `try` bloketik kanpo erabili behar, bai eta [ESLint arau](https://eslint.org/docs/rules/no-return-await) arau bat ere hori debekatzen duena. Horren arrazoia da async/await Node.js 0.10ko transpilagailuekin erabilgarri bihurtu izana (eta jatorrizko laguntza lortu dutela Node.js 7.6 bertsioan) eta "zero kostuko pila aztarna asinkronoak" Node.js 10en gehitua izana eta ondoren Node.js 12tik kendua, `return await` eta `return` guztiz parekoak ziren, edozein `try` kode bloketik kanpo. Oraindik ere berdina izaten jarraituko du seguraski ES motoreentzat. Horregatik, Node.jsentzat jardunbide egokiena da promesak kalkulatzea beraiek bueltatu aurretik. EcmaScriptentzat, ordea, hori ez jardunbide egokiena.
+[Artikulu bikain](https://jakearchibald.com/2017/await-vs-return-vs-return-await/) ugari daude azaltzen dutenak zergatik `return await`ak ez diren inoiz `try` bloketik kanpo erabili behar, bai eta [ESLint arau](https://eslint.org/docs/rules/no-return-await) bat ere hori debekatzen duena. Horren arrazoia da async/await erabilgarri bihurtu izana Node.js 0.10ko transpilagailuekin (eta jatorrizko laguntza lortu dutela Node.js 7.6 bertsioan), eta "zero kostuko pila aztarna asinkronoak" Node.js 10era gehitua izana, eta ondoren Node.js 12tik kendua, `return await` eta `return` guztiz parekoak zirela, edozein `try` kode bloketik kanpo. Oraindik ere berdina izaten jarraituko du seguraski ES motoreentzat. Horregatik, Node.jsrentzat praktika onena da promesak kalkulatzea beraiek bueltatu aurretik. EcmaScriptentzat, ordea, hori ez praktika onena
### Oharrak:
1. Pila aztarna asinkronoak halako ezarpen korapilatsua izatearen beste arrazoi bat da pila aztarna beti modu sinkronoan eraiki behar dela, gertaeraren begiztaren [¹](#1) momentu berean
-2. `throwAsync` barruan `await` gabe, gertaera begiztaren fase berean exekutatuko litzateke kodea. Hori, degeneratutako kasua da: sistema eragilearen **pila** ez litzateke hustuko, eta pila aztarna beteko litzateke funtzioaren emaitzari berariaz itxaron gabe ere. Normalean, promesen erabilerak operazio asinkrono batzuk edukitzen dituenez, pilaren aztarnaren zati batzuk galdu egingo lirateke
+2. `throwAsync` barruan `await` gabe, gertaera begiztaren fase berean exekutatuko litzateke kodea. Hori, degeneratutako kasua da: sistema eragilearen **pila** ez litzateke hustuko, eta pila aztarna beteko litzateke funtzioaren emaitzari berariaz itxaron gabe ere. Normalean, promesen erabilerak operazio asinkrono batzuk edukitzen dituenez, pilaren aztarnaren zati batzuk galdu egingo lirateke
-3. Zero kostuko pila aztarna asinkronoek ez lukete funtzionatuko promesa erabileren kasu korapilatsuetan: promesa bakar bati hainbat aldiz eta leku ezberdinetan itxaron beharra dagoenean, adibidez.
+3. Zero kostuko pila aztarna asinkronoek ez lukete funtzionatuko promesa erabileren kasu korapilatsuetan: promesa bakar bati hainbat aldiz eta leku ezberdinetan itxaron beharra dagoenean, adibidez
### Erreferentziak:
1. [v8ko zero kostuko pila aztarna asinkronoak blog argitarapena](https://v8.dev/blog/fast-async)
-
+
+```javascript
+async function throwAsync(msg) {
+ await null // il faut attendre au moins quelque chose pour être vraiment asynchrone (voir note n° 2)
+ throw Error(msg)
+}
+
+async function returnWithoutAwait () {
+ return throwAsync('manque returnWithoutAwait dans la trace de pile')
+}
+
+// 👎 N'aura PAS la fonction returnWithoutAwait dans la trace de pile
+returnWithoutAwait().catch(console.log)
+```
+
+log reçu
+
+```
+Error: manque returnWithoutAwait dans la trace de pile
+ at throwAsync ([...])
+```
+
+
+```javascript
+async function throwAsync(msg) {
+ await null // il faut attendre au moins quelque chose pour être vraiment asynchrone (voir note n° 2)
+ throw Error(msg)
+}
+
+async function returnWithAwait() {
+ return await throwAsync('avec toutes les instructions présentes')
+}
+
+// 👍 aura la fonction returnWithoutAwait dans la trace de pile
+returnWithAwait().catch(console.log)
+```
+
+log reçu
+
+```
+Error: avec toutes les instructions présentes
+ at throwAsync ([...])
+ at async returnWithAwait ([...])
+```
+
+
+
+```javascript
+async function throwAsync () {
+ await null // il faut attendre au moins quelque chose pour être vraiment asynchrone (voir note n° 2)
+ throw Error('manque syncFn dans la trace de pile')
+}
+
+function syncFn () {
+ return throwAsync()
+}
+
+async function asyncFn () {
+ return await syncFn()
+}
+
+// 👎 syncFn manquera dans la trace de pile parce qu'elle renverra une promesse alors qu'elle est sync
+asyncFn().catch(console.log)
+```
+
+log reçu
+
+```
+Error: manque syncFn dans la trace de pile
+ at throwAsync ([...])
+ at async asyncFn ([...])
+```
+
+
+
+```javascript
+async function throwAsync () {
+ await null // il faut attendre au moins quelque chose pour être vraiment asynchrone (voir note n° 2)
+ throw Error('avec toutes les instructions présentes')
+}
+
+async function changedFromSyncToAsyncFn () {
+ return await throwAsync()
+}
+
+async function asyncFn () {
+ return await changedFromSyncToAsyncFn()
+}
+
+// 👍 maintenant changedFromSyncToAsyncFn sera présent dans la trace de la pile
+asyncFn().catch(console.log)
+```
+
+log reçu
+
+```
+Error: avec toutes les instructions présentes
+ at throwAsync ([...])
+ at changedFromSyncToAsyncFn ([...])
+ at async asyncFn ([...])
+```
+
+
+
+```javascript
+async function getUser (id) {
+ await null
+ if (!id) throw Error('la trace de pile n\'indique pas l\'endroit où getUser a été appelé')
+ return {id}
+}
+
+const userIds = [1, 2, 0, 3]
+
+// 👎 la trace de pile aura la fonction getUser mais ne donnera aucune indication sur l'endroit où elle a été appelée
+Promise.all(userIds.map(getUser)).catch(console.log)
+```
+
+log reçu
+
+```
+Error: la trace de pile n'indique pas l'endroit où getUser a été appelé
+ at getUser ([...])
+ at async Promise.all (index 2)
+```
+
+*Remarque complémentaire* : on pourrait croire que `Promise.all (index 2)` peut aider à comprendre l'endroit où `getUser` a été appelé,
+mais en raison d'un [bogue complètement différent dans la v8](https://bugs.chromium.org/p/v8/issues/detail?id=9023), `(index 2)` est
+une ligne interne de v8
+
+
+
+*Remarque 1* : si vous contrôlez le code de la fonction qui appelle le rappel, changez simplement cette fonction
+en async et ajoutez `await` avant l'appel du rappel. Ci-dessous, je suppose que vous n'êtes pas en charge du code qui appelle
+le rappel (ou que son changement est inacceptable, par exemple en raison de la rétrocompatibilité)
+
+*Remarque 2* : très souvent, l'utilisation du rappel async dans les endroits où l'on s'attend à ce qu'il soit sync ne fonctionnerait pas du tout. Il ne s'agit pas
+de savoir comment réparer le code qui ne fonctionne pas - il s'agit de savoir comment réparer la trace de pile au cas où le code fonctionne déjà
+comme prévu
+
+```javascript
+async function getUser (id) {
+ await null
+ if (!id) throw Error('avec toutes les instructions présentes')
+ return {id}
+}
+
+const userIds = [1, 2, 0, 3]
+
+// 👍 maintenant la ligne ci-dessous est dans la trace de la pile
+Promise.all(userIds.map(async id => await getUser(id))).catch(console.log)
+```
+
+log reçu
+
+```
+Error: avec toutes les instructions présentes
+ at getUser ([...])
+ at async ([...])
+ at async Promise.all (index 2)
+```
+
+grâce au `await` explicite dans `map`, la fin de la ligne `at async ([...])` indique l'endroit exact où
+`getUser` est appelé
+
+*Remarque complémentaire* : si la fonction async qui enveloppe `getUser` n'a pas `await` avant le retour (exemple incorrect n°1 + exemple incorrect n°3)
+alors il ne restera qu'une seule instruction dans la trace de la pile :
+
+```javascript
+[...]
+
+// 👎 exemple incorrect n°1 + exemple incorrect n°3 - une seule instruction dans la trace de la pile
+Promise.all(userIds.map(async id => getUser(id))).catch(console.log)
+```
+
+log reçu
+
+```
+Error: [...]
+ at getUser ([...])
+```
+
+
+
2. [zero kostuko pila aztarna asinkronoei inguruko dokumentazioa ezarpen xehetasunekin hemen](
https://docs.google.com/document/d/13Sy_kBIJGP0XT34V1CV3nkWya4TwYx9L3Yv45LdGB6Q/edit
)
-
+
diff --git a/sections/errorhandling/returningpromises.french.md b/sections/errorhandling/returningpromises.french.md
new file mode 100644
index 000000000..bdbe22e1a
--- /dev/null
+++ b/sections/errorhandling/returningpromises.french.md
@@ -0,0 +1,285 @@
+# Le retour des promesses
+
+
+
+### Un paragraphe d'explication
+
+Lorsqu'une erreur se produit, qu'elle provienne d'un flux synchrone ou asynchrone, il est impératif de disposer d'une trace de pile complète du flux d'erreurs. Étonnamment, lorsqu'une fonction `async` renvoie une promesse sans `await` (par exemple, elle appelle une autre fonction `async`), si une erreur se produit, la fonction appelante n'apparaîtra pas dans la trace de la pile. La personne qui diagnostiquera l'erreur ne disposera donc que d'une information partielle - d'autant plus si la cause de l'erreur se situe dans cette fonction d'appel. Il existe une fonctionnalité v8 appelée "zero-cost async stacktraces" qui permet de ne pas couper les traces de pile sur les `await` les plus récents. Mais sans certaines modalités de mise en œuvre non négligeables, elle ne fonctionnera pas si la valeur de retour d'une fonction (sync ou async) est une promesse. Donc, pour éviter les trous dans les traces de pile lorsque des promesses retournées sont rejetées, nous devons toujours résoudre explicitement les promesses avec `await` avant de les retourner à partir des fonctions.
+
+
+
+### Exemple de code incorrect : appel d'une fonction async sans await
+
+Javascript
+Javascript
+
+
+### Exemple de code incorrect : retourner une promesse sans marquer la fonction comme async
+
+Javascript
+Javascript
+
+
+### Exemple de code incorrect : utilisation directe du rappel async lorsque le rappel sync est attendu
+
+Javascript
+Javascript
+
+
+## Explication approfondie
+
+Les mécanismes des traces de piles des fonctions de sync et des fonctions async dans l'implémentation de la v8 sont très différents :
+La trace de pile sync est basée sur la **pile** fournie par le système d'exploitation sur lequel tourne Node.js (comme dans la plupart des langages
+de programmation). Lorsqu'une fonction async est en cours d'exécution, la **pile** du système d'exploitation l'a sort dès que la
+fonction est arrivée à son premier `await`. Donc la trace de pile async est un mélange de la **pile** du système d'exploitation et d'une
+**chaîne de résolution des promesses** rejetées. L'implémentation "zero-cost async stacktraces" étend la **chaîne de résolution des promesses**
+uniquement lorsque la promesse est `awaited` [¹](#1). Parce que seules les fonctions `async` peuvent `await`,
+la fonction sync sera toujours manquante dans la trace de la pile async si une opération async a été effectuée après que la fonction
+a été appelé [²](#2)
+
+### Le compromis
+
+Chaque `await` crée une nouvelle micro-tâche dans la boucle d'événement, donc l'ajout d'autres `await` dans le code
+introduit une certaine pénalité de performance. Néanmoins, la pénalité de performance introduite par le réseau ou
+la base de données est [énormément plus grande](https://colin-scott.github.io/personal_website/research/interactive_latency.html)
+donc la pénalité supplémentaire `await` n'est pas quelque chose qui devrait être considéré pendant le développement de serveurs web ou de CLI
+sauf pour un code très chaud par requête ou commande. Donc, la suppression de `await` dans
+les `return await` devrait être l'un des derniers moyens pour améliorer sensiblement les performances
+et ne doit absolument pas être fait en amont.
+
+
+### Pourquoi return await était considéré comme incorrect dans le passé
+
+Un certain nombre d'[excellents articles](https://jakearchibald.com/2017/await-vs-return-vs-return-await/) expliquent
+pourquoi `return await` ne devrait jamais être utilisée en dehors du bloc `try` et même une
+[règle ESLint](https://eslint.org/docs/rules/no-return-await) l'interdit. La raison, c'est que depuis que async/await
+est disponible avec des transpileurs dans Node.js 0.10 (et a obtenu un support natif dans Node.js 7.6) et jusqu'à ce
+que "zero-cost async stacktraces" a été introduit dans Node.js 10 et démarqué dans Node.js 12, `return await` était absolument
+équivalent à `return` pour tout code en dehors du bloc `try`. Il se peut que ce soit encore le cas pour certains autres moteurs ES.
+C'est pourquoi la résolution des promesses avant de les retourner est la meilleure pratique pour Node.js et non pour EcmaScript en général
+
+### Remarques :
+
+1. Une autre raison pour laquelle la trace de pile async a une implémentation aussi délicate, c'est que la trace de pile
+doit toujours être construite de manière synchrone, sur le même rythme que la boucle d'événement [¹](#1)
+2. Sans `await` dans `throwAsync`, le code serait exécuté dans la même phase de la boucle d'événements. C'est un cas
+dégradé où la **pile** de l'OS ne serait pas vide et la trace de pile serait pleine même sans attendre
+explicitement le résultat de la fonction. Habituellement, l'utilisation des promesses inclut des opérations asynchrones
+et des parties de la trace de la pile sont perdues
+3. Zero-cost async stacktraces ne fonctionnera toujours pas pour les usages compliqués de la promesse, par exemple la promesse unique
+attendue à plusieurs reprises dans différents endroits
+
+### Références :
+ 1. [article de blog sur zero-cost async stacktraces en v8](https://v8.dev/blog/fast-async)
+
+
+ 2. [Document sur zero-cost async stacktraces avec les détails de mise en œuvre mentionnés ici](
+ https://docs.google.com/document/d/13Sy_kBIJGP0XT34V1CV3nkWya4TwYx9L3Yv45LdGB6Q/edit
+ )
+
diff --git a/sections/errorhandling/returningpromises.md b/sections/errorhandling/returningpromises.md
index 7ba1861ca..11ebc5a67 100644
--- a/sections/errorhandling/returningpromises.md
+++ b/sections/errorhandling/returningpromises.md
@@ -4,7 +4,7 @@
### One Paragraph Explainer
-When an error occurs, whether from a synchronous or asynchronous flow, it's imperative to have a full stacktrace of the error flow. Surprisingly, if an async function returns a promise (e.g., calls other async function) without awaiting, should an error occur then the caller function won't appear in the stacktrace. This will leave the person who diagnoses the error with partial information - All the more if the error cause lies within that caller function. There is a feature v8 called "zero-cost async stacktraces" that allow stacktraces not to be cut on the most recent `await`. But due to non-trivial implementation details, it will not work if the return value of a function (sync or async) is a promise. So, to avoid holes in stacktraces when returned promises would be rejected, we must always explicitly resolve promises with `await` before returning them from functions
+When an error occurs, whether from a synchronous or asynchronous flow, it's imperative to have a full stacktrace of the error flow. Surprisingly, if an async function returns a promise (e.g. calls other async function) without awaiting, should an error occur then the caller function won't appear in the stacktrace. This will leave the person who diagnoses the error with partial information - All the more if the error cause lies within that caller function. There is a v8 feature called "zero-cost async stacktraces" that allows stacktraces to not be cut on the most recent `await`. But due to non-trivial implementation details, it will not work if the return value of a function (sync or async) is a promise. So, to avoid holes in stacktraces when returned promises would be rejected, we must always explicitly resolve promises with `await` before returning them from functions
@@ -87,7 +87,7 @@ async function asyncFn () {
return await syncFn()
}
-// 👎 syncFn would be missing in the stacktrace because it returns a promise while been sync
+// 👎 syncFn would be missing in the stacktrace because it returns a promise while being sync
asyncFn().catch(console.log)
```
@@ -137,7 +137,7 @@ Error: with all frames present
-*Note 1*: in case if you control the code of the function that would call the callback - just change that function to
-async and add `await` before the callback call. Below I assume that you are not in charge of the code that is calling
-the callback (or it's change is unacceptable for example because of backward compatibility)
+*Note 1*: if you control the code of the function that would call the callback - just change that function to
+`async` and add `await` before the callback call. Below I assume that you are not in charge of the code that is calling
+the callback (or its change is unacceptable for example because of backward compatibility)
*Note 2*: quite often usage of async callback in places where sync one is expected would not work at all. This is not about
how to fix the code that is not working - it's about how to fix stacktrace in case if code is already working as
@@ -210,8 +210,8 @@ Error: with all frames present
where thanks to explicit `await` in `map`, the end of the line `at async ([...])` would point to the exact place where
`getUser` has been called
-*Side-note*: if async function that wrap `getUser` would miss `await` before return (anti-pattern #1 + anti-pattern #3)
-then only one frame would left in the stacktrace:
+*Side-note*: if async function that wrap `getUser` lacks `await` before return (anti-pattern #1 + anti-pattern #3)
+then only one frame would be left in the stacktrace:
```javascript
[...]
@@ -235,12 +235,12 @@ Error: [...]
## Advanced explanation
The mechanisms behind sync functions stacktraces and async functions stacktraces in v8 implementation are quite different:
-sync stacktrace is based on **stack** provided by operating system Node.js is running on (just like in most programming
-languages). When an async function is executing, the **stack** of operating system is popping it out as soon as the
-function is getting to it's first `await`. So async stacktrace is a mix of operating system **stack** and a rejected
-**promise resolution chain**. Zero-cost async stacktraces implementation is extending the **promise resolution chain**
+sync stacktrace is based on **stack** provided by the operating system Node.js is running on (just like in most programming
+languages). When an async function is executing, the **stack** of the operating system is popping it out as soon as the
+function gets to its first `await`. So async stacktrace is a mix of operating system **stack** and a rejected
+**promise resolution chain**. Zero-cost async stacktraces implementation extends the **promise resolution chain**
only when the promise is getting `awaited` [¹](#1). Because only `async` functions may `await`,
-sync function would always be missed in async stacktrace if any async operation has been performed after the function
+sync function would always be missing from async stacktrace if any async operation has been performed after the function
has been called [²](#2)
### The tradeoff
@@ -256,30 +256,30 @@ definitely should never be done up-front
### Why return await was considered as anti-pattern in the past
-There is a number of [excellent articles](https://jakearchibald.com/2017/await-vs-return-vs-return-await/) explained
+There is a number of [excellent articles](https://jakearchibald.com/2017/await-vs-return-vs-return-await/) explaining
why `return await` should never be used outside of `try` block and even an
[ESLint rule](https://eslint.org/docs/rules/no-return-await) that disallows it. The reason for that is the fact that
since async/await become available with transpilers in Node.js 0.10 (and got native support in Node.js 7.6) and until
"zero-cost async stacktraces" was introduced in Node.js 10 and unflagged in Node.js 12, `return await` was absolutely
equivalent to `return` for any code outside of `try` block. It may still be the same for some other ES engines. This
-is why resolving promises before returning them is the best practice for Node.js and not for the EcmaScript in general
+is why resolving promises before returning them is the best practice for Node.js and not for ECMAScript in general
### Notes:
-1. One another reason why async stacktrace has such tricky implementation is the limitation that stacktrace
+1. One other reason why async stacktrace has such tricky implementation is the limitation that stacktrace
must always be built synchronously, on the same tick of event loop [¹](#1)
2. Without `await` in `throwAsync` the code would be executed in the same phase of event loop. This is a
degenerated case when OS **stack** would not get empty and stacktrace be full even without explicitly
-awaiting the function result. Usually usage of promises include some async operations and so parts of
+awaiting the function result. Common usage of promises includes some async operations and so parts of
the stacktrace would get lost
3. Zero-cost async stacktraces still would not work for complicated promise usages e.g. single promise
awaited many times in different places
### References:
1. [Blog post on zero-cost async stacktraces in v8](https://v8.dev/blog/fast-async)
-
@@ -41,7 +41,7 @@ Error: missing returnWithoutAwait in the stacktrace
@@ -142,7 +142,7 @@ Error: with all frames present
+
2. [Document on zero-cost async stacktraces with mentioned here implementation details](
https://docs.google.com/document/d/13Sy_kBIJGP0XT34V1CV3nkWya4TwYx9L3Yv45LdGB6Q/edit
)
-
+
diff --git a/sections/errorhandling/returningpromises.russian.md b/sections/errorhandling/returningpromises.russian.md
index ed58d69f8..01df84106 100644
--- a/sections/errorhandling/returningpromises.russian.md
+++ b/sections/errorhandling/returningpromises.russian.md
@@ -12,7 +12,7 @@
-### Анти-паттерн №1: return \Javascript
Javascript
### Анти-паттерн №3: прямая передача асинхронного коллбэка в месте где ожидается синхронный коллбек
@@ -281,9 +281,9 @@ Error: [...]
### References:
1. [Блогпост о бесплатных асинхронных стектрейсах в v8](https://v8.dev/blog/fast-async)
-
+
2. [Документ о бесплатных асинхронных стектрейсах в v8 с упомянутыми тут деталями реализации](
https://docs.google.com/document/d/13Sy_kBIJGP0XT34V1CV3nkWya4TwYx9L3Yv45LdGB6Q/edit
)
-
+
diff --git a/sections/errorhandling/shuttingtheprocess.basque.md b/sections/errorhandling/shuttingtheprocess.basque.md
index 835b3494b..693bad28e 100644
--- a/sections/errorhandling/shuttingtheprocess.basque.md
+++ b/sections/errorhandling/shuttingtheprocess.basque.md
@@ -1,8 +1,8 @@
# Irten prozesutik elegantziarekin kanpoko norbait iristen denean hirira
-### Azalpen paragrafoa
+### Azalpena
-Zure kodearen lekuren batean, erroreren bat gertatzen denean erroreen kudeaketa objektuaren ardura da erabakitzea nola jokatu, eta, errorea konfiantzazkoa bada, nahikoa izango da erregistro fitxategian idaztea; errorea operazionala bada, berriz, irakurri azalpen osatuagoa #3 jarraibide egokian). Gauzak okertzen dira errorea ezezaguna denean, horrek osagairen bat egoera txarrean dagoela eta hurrengo eskaera guztiek huts egiteko aukera handia dutela esan nahi du eta. Adibidez, eman dezagun, singleton bat edukita, token batek salbuespen bat igorri duela eta ondoren bere egoera galdu duen zerbitzu batekin arazoa duela; hortik aurrera ustekabean joka dezake eta eskaera guztiek huts egitea eragin. Egoera horren aurrean, prozesua gelditu eta 'Berrekite tresna' erabili (Forever, PM2, etab. bezalakoak) egoera garbi batekin berriz hasteko.
+Zure kodearen lekuren batean, erroreren bat gertatzen denean erroreen kudeaketa objektuaren ardura da erabakitzea nola jokatu, eta, errorea konfiantzazkoa bada, nahikoa izango da erregistro fitxategian idaztea; errorea operazionala bada, berriz, irakurri azalpen osatuagoa #3 jarraibide egokian). Gauzak okertzen dira errorea ezezaguna denean, horrek osagairen bat egoera txarrean dagoela eta hurrengo eskaera guztiek huts egiteko aukera handia dutela esan nahi du eta. Adibidez, eman dezagun, singleton bat edukita, token batek salbuespen bat igorri duela eta ondoren bere egoera galdu duen zerbitzu batekin arazoa duela; hortik aurrera ustekabean joka dezake eta eskaera guztiek huts egitea eragin. Egoera horren aurrean, prozesua gelditu eta 'Berrekite tresna' erabili (Forever, PM2, etab. bezalakoak) egoera garbi batekin berriz hasteko
### Kode adibidea: huts eragin ala ez erabakitzen
@@ -77,23 +77,23 @@ export const kudeatzailea = new ErroreKudeatzailea();
```