Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTFException should derive from UnicodeException #7145

Merged
merged 1 commit into from
Aug 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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