aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSphinxKnight <SphinxKnight@users.noreply.github.com>2022-03-03 23:39:44 +0100
committerGitHub <noreply@github.com>2022-03-03 23:39:44 +0100
commit34ed61153801e8c35ccd931afd994a3c7cfbcb20 (patch)
tree820bddde8b89113cd698f67a78dd8f28b21181d2
parentd5227564131854889f18abd8e8297751e7c5c9e5 (diff)
downloadtranslated-content-34ed61153801e8c35ccd931afd994a3c7cfbcb20.tar.gz
translated-content-34ed61153801e8c35ccd931afd994a3c7cfbcb20.tar.bz2
translated-content-34ed61153801e8c35ccd931afd994a3c7cfbcb20.zip
Update URIError docs / translate missing constructor page (#4386)
* Update URIError docs / translate missing page * missing title translation
-rw-r--r--files/fr/web/javascript/reference/global_objects/urierror/index.md109
-rw-r--r--files/fr/web/javascript/reference/global_objects/urierror/urierror/index.md77
2 files changed, 118 insertions, 68 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/urierror/index.md b/files/fr/web/javascript/reference/global_objects/urierror/index.md
index d4dcd6db35..3b05836642 100644
--- a/files/fr/web/javascript/reference/global_objects/urierror/index.md
+++ b/files/fr/web/javascript/reference/global_objects/urierror/index.md
@@ -1,54 +1,33 @@
---
title: URIError
slug: Web/JavaScript/Reference/Global_Objects/URIError
-tags:
- - Error
- - JavaScript
- - Object
- - Reference
- - URIError
translation_of: Web/JavaScript/Reference/Global_Objects/URIError
original_slug: Web/JavaScript/Reference/Objets_globaux/URIError
+browser-compat: javascript.builtins.URIError
---
{{JSRef}}
L'objet **`URIError`** représente une erreur renvoyée lorsqu'une fonction de manipulation d'URI a été utilisée de façon inappropriée.
-## Syntaxe
+## Constructeur
- new URIError([message[, nomFichier[, numéroLigne]]])
+- [`URIError()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/URIError/URIError)
+ - : Crée un nouvel objet `URIError`.
-### Paramètres
+## Propriétés des instances
-- `message`
- - : Ce paramètre est optionnel. Il correspond à un chaîne de caractères décrivant l'erreur de façon compréhensible.
-- `nomFichier` {{non-standard_inline}}
- - : Ce paramètre est optionnel. Il correspond au nom du fichier contenant le code à l'origine de l'exception.
-- `numéroLigne` {{non-standard_inline}}
- - : Ce paramètre est optionnel. Il correspond au numéro de la ligne dans le fichier contenant le code qui a entraîné l'exception.
-
-## Description
-
-Une exception `URIError` est lancée lorsque les fonctions de gestion d'URI reçoivent une URI mal formée.
-
-## Propriétés
-
-- {{jsxref("URIError.prototype")}}
- - : Cette propriété permet d'ajouter des propriétés à un objet `URIError`.
-
-## Méthodes
-
-L'objet global `URIError` ne contient aucune méthode qui lui soit directement attachée. Cependant, il hérite de certaines méthodes grâce à sa chaîne de prototypes.
-
-## Instances d'`URIError`
-
-### Propriétés
-
-{{page('/fr/docs/Web/JavaScript/Reference/Objets_globaux/URIError/prototype', 'Propriétés')}}
-
-### Méthodes
-
-{{page('/fr/docs/Web/JavaScript/Reference/Objets_globaux/URIError/prototype', 'Méthodes')}}
+- [`URIError.prototype.message`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error/message)
+ - : Le message d'erreur.
+- [`URIError.prototype.name`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error/name)
+ - : Le nom de l'erreur. Héritée de [`Error`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error).
+- [`URIError.prototype.fileName`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName)
+ - : Le chemin du fichier qui a déclenché l'erreur. Héritée de [`Error`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error).
+- [`URIError.prototype.lineNumber`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error/lineNumber)
+ - : Le numéro de la ligne dans le fichier qui a déclenché l'erreur. Héritée de [`Error`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error).
+- [`URIError.prototype.columnNumber`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error/columnNumber)
+ - : Le numéro de la colonne dans la ligne du fichier qui a déclenché l'erreur. Héritée de [`Error`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error).
+- [`URIError.prototype.stack`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack)
+ - : La pile d'appel. Héritée de [`Error`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error).
## Exemples
@@ -56,52 +35,46 @@ L'objet global `URIError` ne contient aucune méthode qui lui soit directement a
```js
try {
- decodeURIComponent('%');
+ decodeURIComponent('%')
} catch (e) {
- console.log(e instanceof URIError); // true
- console.log(e.message); // "malformed URI sequence"
- console.log(e.name); // "URIError"
- console.log(e.fileName); // "Scratchpad/1"
- console.log(e.lineNumber); // 2
- console.log(e.columnNumber); // 2
- console.log(e.stack); // "@Scratchpad/2:2:3\n"
+ console.log(e instanceof URIError) // true
+ console.log(e.message) // "malformed URI sequence"
+ console.log(e.name) // "URIError"
+ console.log(e.fileName) // "Scratchpad/1"
+ console.log(e.lineNumber) // 2
+ console.log(e.columnNumber) // 2
+ console.log(e.stack) // "@Scratchpad/2:2:3\n"
}
```
-### Créer une exception `URIError`
+### Créer une instance de `URIError`
```js
try {
- throw new URIError('Coucou', 'monFichier.js', 10);
+ throw new URIError('Coucou', 'unFichier.js', 10)
} catch (e) {
- console.log(e instanceof URIError); // true
- console.log(e.message); // "Coucou"
- console.log(e.name); // "URIError"
- console.log(e.fileName); // "monFichier.js"
- console.log(e.lineNumber); // 10
- console.log(e.columnNumber); // 0
- console.log(e.stack); // "@Scratchpad/2:2:9\n"
+ console.log(e instanceof URIError) // true
+ console.log(e.message) // "Coucou"
+ console.log(e.name) // "URIError"
+ console.log(e.fileName) // "unFichier.js"
+ console.log(e.lineNumber) // 10
+ console.log(e.columnNumber) // 0
+ console.log(e.stack) // "@Scratchpad/2:2:9\n"
}
```
## Spécifications
-| Spécification | Statut | Commentaires |
-| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | -------------------- |
-| {{SpecName('ES3', '#sec-15.11.6.6', 'URIError')}} | {{Spec2('ES3')}} | Définition initiale. |
-| {{SpecName('ES5.1', '#sec-15.11.6.6', 'URIError')}} | {{Spec2('ES5.1')}} |   |
-| {{SpecName('ES6', '#sec-native-error-types-used-in-this-standard-urierror', 'URIError')}} | {{Spec2('ES6')}} |   |
-| {{SpecName('ESDraft', '#sec-native-error-types-used-in-this-standard-urierror', 'URIError')}} | {{Spec2('ESDraft')}} |   |
+{{Specifications}}
## Compatibilité des navigateurs
-{{Compat("javascript.builtins.URIError")}}
+{{Compat}}
## Voir aussi
-- {{jsxref("Error")}}
-- {{jsxref("URIError.prototype")}}
-- {{jsxref("Objets_globaux/decodeURI", "decodeURI()")}}
-- {{jsxref("Objets_globaux/decodeURIComponent", "decodeURIComponent()")}}
-- {{jsxref("Objets_globaux/encodeURI", "encodeURI()")}}
-- {{jsxref("Objets_globaux/encodeURIComponent", "encodeURIComponent()")}}
+- [`Error`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error)
+- [`decodeURI()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/decodeURI)
+- [`decodeURIComponent()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent)
+- [`encodeURI()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/encodeURI)
+- [`encodeURIComponent()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent)
diff --git a/files/fr/web/javascript/reference/global_objects/urierror/urierror/index.md b/files/fr/web/javascript/reference/global_objects/urierror/urierror/index.md
new file mode 100644
index 0000000000..94c4e9cd9e
--- /dev/null
+++ b/files/fr/web/javascript/reference/global_objects/urierror/urierror/index.md
@@ -0,0 +1,77 @@
+---
+title: Constructeur URIError()
+slug: Web/JavaScript/Reference/Global_Objects/URIError/URIError
+translation_of: Web/JavaScript/Reference/Global_Objects/URIError/URIError
+browser-compat: javascript.builtins.URIError.URIError
+---
+{{JSRef}}
+
+Le constructeur **`URIError()`** permet de créer une erreur lorsqu'une fonction de gestion d'un URI a été utilisée de façon incorrecte.
+
+## Syntaxe
+
+```js
+new URIError()
+new URIError(message)
+new URIError(message, fileName)
+new URIError(message, fileName, lineNumber)
+```
+
+### Paramètres
+
+- `message` {{optional_inline}}
+ - : Une description de l'erreur, compréhensible par un humain.
+- `fileName` {{optional_inline}}
+ - : Le nom du fichier qui contient le code ayant déclenché l'exception.
+- `lineNumber` {{optional_inline}}
+ - : Le numéro de ligne pour le code ayant déclenché l'exception.
+
+## Exemples
+
+### Intercepter une exception `URIError`
+
+```js
+try {
+ decodeURIComponent('%')
+} catch (e) {
+ console.log(e instanceof URIError) // true
+ console.log(e.message) // "malformed URI sequence"
+ console.log(e.name) // "URIError"
+ console.log(e.fileName) // "Scratchpad/1"
+ console.log(e.lineNumber) // 2
+ console.log(e.columnNumber) // 2
+ console.log(e.stack) // "@Scratchpad/2:2:3\n"
+}
+```
+
+### Créer une instance de `URIError`
+
+```js
+try {
+ throw new URIError('Coucou', 'unFichier.js', 10)
+} catch (e) {
+ console.log(e instanceof URIError) // true
+ console.log(e.message) // "Coucou"
+ console.log(e.name) // "URIError"
+ console.log(e.fileName) // "unFichier.js"
+ console.log(e.lineNumber) // 10
+ console.log(e.columnNumber) // 0
+ console.log(e.stack) // "@Scratchpad/2:2:9\n"
+}
+```
+
+## Spécifications
+
+{{Specifications}}
+
+## Compatibilité des navigateurs
+
+{{Compat}}
+
+## Voir aussi
+
+- [`Error`](/fr/docs/Web/JavaScript/Reference/Global_Objects/Error)
+- [`decodeURI()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/decodeURI)
+- [`decodeURIComponent()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent)
+- [`encodeURI()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/encodeURI)
+- [`encodeURIComponent()`](/fr/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent)