Skip to content

Commit

Permalink
Merge pull request #7145 from WalterBright/UTFException
Browse files Browse the repository at this point in the history
UTFException should derive from UnicodeException
merged-on-behalf-of: Walter Bright <[email protected]>
  • Loading branch information
dlang-bot authored Aug 16, 2019
2 parents 858b1d4 + 232d9e6 commit 4041bbd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions std/utf.d
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ $(TR $(TD Miscellaneous) $(TD
module std.utf;

import std.exception : basicExceptionCtors;
import core.exception : UnicodeException;
import std.meta : AliasSeq;
import std.range.primitives;
import std.traits : isAutodecodableString, isPointer, isSomeChar,
Expand All @@ -71,7 +72,7 @@ import std.typecons : Flag, Yes, No;
/++
Exception thrown on errors in std.utf functions.
+/
class UTFException : Exception
class UTFException : UnicodeException
{
import core.internal.string : unsignedToTempString, UnsignedStringBuf;

Expand All @@ -97,15 +98,15 @@ class UTFException : Exception
this(string msg, string file = __FILE__, size_t line = __LINE__,
Throwable next = null) @nogc @safe pure nothrow
{
super(msg, file, line, next);
super(msg, 0, file, line, next);
}
/// ditto
this(string msg, size_t index, string file = __FILE__,
size_t line = __LINE__, Throwable next = null) @safe pure nothrow
{
UnsignedStringBuf buf = void;
msg ~= " (at index " ~ unsignedToTempString(index, buf, 10) ~ ")";
super(msg, file, line, next);
super(msg, index, file, line, next);
}

/**
Expand Down

0 comments on commit 4041bbd

Please sign in to comment.