Skip to content

Commit

Permalink
UTFException should derive from UnicodeException
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Aug 16, 2019
1 parent 858b1d4 commit 232d9e6
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 232d9e6

Please sign in to comment.