diff options
| author | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2021-09-04 00:46:12 +0900 |
|---|---|---|
| committer | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2021-09-04 00:46:12 +0900 |
| commit | fe6f6abf2b7c497bf1f97f73a82dde7cf48eb79f (patch) | |
| tree | 51b7edfc370236684a203f4e69ae67bb7d24b549 /files/fr/web/javascript/reference/global_objects/aggregateerror/index.html | |
| parent | 04ea4edc83cc12142ed151bbea2c65cffc8e76f6 (diff) | |
| parent | eeb07fe338cdc90092841d717919f46f9d9e3ff9 (diff) | |
| download | translated-content-fe6f6abf2b7c497bf1f97f73a82dde7cf48eb79f.tar.gz translated-content-fe6f6abf2b7c497bf1f97f73a82dde7cf48eb79f.tar.bz2 translated-content-fe6f6abf2b7c497bf1f97f73a82dde7cf48eb79f.zip | |
Merge branch 'main' into 20210818-Glossary/Type
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/aggregateerror/index.html')
| -rw-r--r-- | files/fr/web/javascript/reference/global_objects/aggregateerror/index.html | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/aggregateerror/index.html b/files/fr/web/javascript/reference/global_objects/aggregateerror/index.html deleted file mode 100644 index 408d49a007..0000000000 --- a/files/fr/web/javascript/reference/global_objects/aggregateerror/index.html +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: AggregateError -slug: Web/JavaScript/Reference/Global_Objects/AggregateError -tags: - - AggregateError - - Classe - - Experimental - - Interface - - JavaScript -translation_of: Web/JavaScript/Reference/Global_Objects/AggregateError -original_slug: Web/JavaScript/Reference/Objets_globaux/AggregateError ---- -<div>{{JSRef}}</div> - -<p>Un objet <code><strong>AggregateError</strong></code> représente une erreur lorsque plusieurs erreurs doivent être agrégées en une seule. Ce type d'exception est levée lorsque plusieurs erreurs sont rapportées par une opération, par exemple avec {{JSxRef("Promise.any()")}} lorsque l'ensemble des promesses qui lui sont passées échouent.</p> - -<h2 id="Constructeur">Constructeur</h2> - -<dl> - <dt><a href="/fr/docs/Web/JavaScript/Reference/Objets_globaux/AggregateError/AggregateError"><code>AggregateError()</code></a></dt> - <dd>Crée un nouvel objet <code>AggregateError</code>.</dd> -</dl> - -<h2 id="Propriétés_des_instances">Propriétés des instances</h2> - -<dl> - <dt>{{JSxRef("Error.prototype.message", "AggregateError.prototype.message")}}</dt> - <dd>Le message d'erreur. La valeur par défaut est <code>""</code>.</dd> - <dt>{{JSxRef("Error.prototype.name", "AggregateError.prototype.name")}}</dt> - <dd>Le nom de l'erreur. La valeur par défaut est <code>"AggregateError"</code>.</dd> -</dl> - -<h2 id="Exemples">Exemples</h2> - -<h3 id="Intercepter_une_erreur_AggregateError">Intercepter une erreur <code>AggregateError</code></h3> - -<pre class="brush: js; notranslate">Promise.any([ - Promise.reject(new Error("une erreur")), -]).catch(e => { - console.log(e instanceof AggregateError); // true - console.log(e.message); // "All Promises rejected" - console.log(e.name); // "AggregateError" - console.log(e.errors); // [ Error: "une erreur" ] -}); -</pre> - -<h3 id="Créer_un_objet_AggregateError">Créer un objet <code>AggregateError</code></h3> - -<pre class="brush: js; notranslate">try { - throw new AggregateError([ - new Error("une erreur"), - ], 'Coucou'); -} catch (e) { - console.log(e instanceof AggregateError); // true - console.log(e.message); // "Coucou" - console.log(e.name); // "AggregateError" - console.log(e.errors); // [ Error: "une erreur" ] -} -</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Spécification</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('Promise.any', '#sec-aggregate-error-object-structure', 'AggregateError')}}</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("javascript.builtins.AggregateError")}}</p> - -<h2 id="Voir">Voir</h2> - -<ul> - <li>{{JSxRef("Error")}}</li> -</ul> |
