Bug 11338 – std.uri URIerror should be an Exception

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-24T02:45:55Z
Last change time
2020-03-21T03:56:33Z
Assigned to
No Owner
Creator
Danny Arends

Comments

Comment #0 by Danny.Arends — 2013-10-24T02:45:55Z
I'd like to be able to use the following code import std.uri; string req_uri; try{ req_uri = decode(unsafeUserString); }catch(Exception e){ req_uri = "/"; } Currently it throws an Error... an error (Non-recoverable) is a bit harsh IMHO
Comment #1 by github-bugzilla — 2013-11-01T09:20:07Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/1fd19c2366e3d1f41ddff5adc3d73820faf56ad4 Fix of Issue 11338 - URIerror renamed to URIexception - URIexception class inherits from Exception https://github.com/D-Programming-Language/phobos/commit/fa0627b21854a3d7be461da20632e474d07c4b66 Fix Issue 11338 - Now call the onOutOfMemoryError() function when alloca returns NULL - Fixed the URIexception name to URIException - Added a string constructor for the URIException class - Added more informative messages to some of the errors https://github.com/D-Programming-Language/phobos/commit/74d59dd7db418126f323586bcc9a09ca6b69b69a Fixing Issue 11338 - Additional - Now all thrown URIException have human readable text - throw new OutOfMemoryError("Alloca Failure"); // Make code look more consistant https://github.com/D-Programming-Language/phobos/commit/42eec50ffe2f315dfb8caac3b8c110058115b880 Merge pull request #1659 from DannyArends/issue_11338 Fix Issue 11338 - std.uri URIerror should be an Exception
Comment #2 by b2.temp — 2015-11-27T16:54:23Z