<div dir="ltr"><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">Hi,</p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"><br></p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">This is a bug in the type spec and as far as I see the catch is unnecessary in uri_string:normalize/1 as exceptions are already caught in all other functions that are called by normalize.</p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">The intended behavior is to always return an error tuple in case of an error.</p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"><br></p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">BR/Peter</p><p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"><br></p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"><a name="_MailOriginal"><span lang="EN-US">-----Original
Message-----<br>
From: erlang-questions <erlang-questions-bounces@erlang.org> On Behalf Of
Loïc Hoguin<br>
Sent: den 23 november 2019 17:21<br>
To: Erlang Questions <erlang-questions@erlang.org><br>
Subject: uri_string weird inconsistency</span></a></p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"> </p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">Hello,</p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"> </p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">Why does
uri_string:normalize/1 catch a throw and return an error tuple, but
uri_string:normalize/2 does not? Both are documented functions and this
behavior difference is not documented, besides the 2-arity not having error()
as a returned type: </p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"><a href="https://protect2.fireeye.com/v1/url?k=8b83a40f-d70986e6-8b83e494-0cc47ad93e2e-315c3a8c3f88d867&q=1&e=db14f46e-9908-4d65-828f-a5804e01ef18&u=http%3A%2F%2Ferlang.org%2Fdoc%2Fman%2Furi_string.html%23normalize-1"><span style="color:windowtext;text-decoration-line:none">https://protect2.fireeye.com/v1/url?k=8b83a40f-d70986e6-8b83e494-0cc47ad93e2e-315c3a8c3f88d867&q=1&e=db14f46e-9908-4d65-828f-a5804e01ef18&u=http%3A%2F%2Ferlang.org%2Fdoc%2Fman%2Furi_string.html%23normalize-1</span></a></p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"> </p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">Is this an
oversight perhaps?</p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"> </p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">Cheers,</p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"> </p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">--</p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif">Loïc Hoguin</p>
<p class="gmail-MsoPlainText" style="margin:0cm 0cm 0.0001pt;font-size:14pt;font-family:Calibri,sans-serif"><a href="https://protect2.fireeye.com/v1/url?k=3f9e31b6-6314135f-3f9e712d-0cc47ad93e2e-d1a6f2e3a8affc9e&q=1&e=db14f46e-9908-4d65-828f-a5804e01ef18&u=https%3A%2F%2Fninenines.eu%2F"><span style="color:windowtext;text-decoration-line:none">https://protect2.fireeye.com/v1/url?k=3f9e31b6-6314135f-3f9e712d-0cc47ad93e2e-d1a6f2e3a8affc9e&q=1&e=db14f46e-9908-4d65-828f-a5804e01ef18&u=https%3A%2F%2Fninenines.eu%2F</span></a></p></div>