From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- .../reference/global_objects/urierror/index.html | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 files/fr/web/javascript/reference/global_objects/urierror/index.html (limited to 'files/fr/web/javascript/reference/global_objects/urierror') diff --git a/files/fr/web/javascript/reference/global_objects/urierror/index.html b/files/fr/web/javascript/reference/global_objects/urierror/index.html new file mode 100644 index 0000000000..7142b5dbe4 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/urierror/index.html @@ -0,0 +1,137 @@ +--- +title: URIError +slug: Web/JavaScript/Reference/Objets_globaux/URIError +tags: + - Error + - JavaScript + - Object + - Reference + - URIError +translation_of: Web/JavaScript/Reference/Global_Objects/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

+ +
new URIError([message[, nomFichier[, numéroLigne]]])
+ +

Paramètres

+ +
+
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')}}
+ +

Exemples

+ +

Intercepter une exception URIError

+ +
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 exception URIError

+ +
try {
+  throw new URIError('Coucou', 'monFichier.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"
+}
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaires
{{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')}} 
+ +

Compatibilité des navigateurs

+ +
+ + +

{{Compat("javascript.builtins.URIError")}}

+
+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf