uri_string weird inconsistency
Peter Dimitrov
peterdmv@REDACTED
Mon Nov 25 10:56:01 CET 2019
Hi,
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.
The intended behavior is to always return an error tuple in case of an
error.
BR/Peter
-----Original Message-----
From: erlang-questions <erlang-questions-bounces@REDACTED> On Behalf Of
Loïc Hoguin
Sent: den 23 november 2019 17:21
To: Erlang Questions <erlang-questions@REDACTED>
Subject: uri_string weird inconsistency
Hello,
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:
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
Is this an oversight perhaps?
Cheers,
--
Loïc Hoguin
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20191125/9dec9ee9/attachment.htm>
More information about the erlang-questions
mailing list