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 af60421
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions std/utf.d
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $(TR $(TD Miscellaneous) $(TD
+/
module std.utf;

import std.exception : basicExceptionCtors;
import std.exception : basicExceptionCtors, UnicodeException;
import std.meta : AliasSeq;
import std.range.primitives;
import std.traits : isAutodecodableString, isPointer, isSomeChar,
Expand All @@ -71,7 +71,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 +97,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 af60421

Please sign in to comment.