dmd.errors
Functions for raising errors.
License
Source: errors.d
Documentation: https://dlang.org/phobos/dmd_errors.html
-
Declaration
enumClassification: Color;Color highlighting to classify messages
-
Declaration
errorfor errors
-
Declaration
gaggedfor
gaggederrors -
Declaration
warningfor warnings
-
Declaration
deprecationfor deprecations
-
Declaration
tipfor
tipmessages
-
-
Declaration
nothrow voiderror(ref const Locloc, const(char)*format, ...);Print an
errormessage, increasing the globalerrorcount.Parameters
Locloclocation of
errorconst(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voiderror(const(char)*filename, uintlinnum, uintcharnum, const(char)*format, ...);Same as above, but takes a
filenameand line information arguments as separate parameters.Parameters
const(char)*filenamesource file of
erroruintlinnumline in the source file
uintcharnumcolumn number on the line
const(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voiderrorSupplemental(ref const Locloc, const(char)*format, ...);Print additional details about an error message. Doesn't increase the error count or print an additional error prefix.
Parameters
Locloclocation of error
const(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voidwarning(ref const Locloc, const(char)*format, ...);Print a
warningmessage, increasing the globalwarningcount.Parameters
Locloclocation of
warningconst(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voidwarningSupplemental(ref const Locloc, const(char)*format, ...);Print additional details about a warning message. Doesn't increase the warning count or print an additional warning prefix.
Parameters
Locloclocation of warning
const(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voiddeprecation(ref const Locloc, const(char)*format, ...);Print a
deprecationmessage, may increase the global warning or error count depending on whether deprecations are ignored.Parameters
Locloclocation of
deprecationconst(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voiddeprecationSupplemental(ref const Locloc, const(char)*format, ...);Print additional details about a deprecation message. Doesn't increase the error count, or print an additional deprecation prefix.
Parameters
Locloclocation of deprecation
const(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voidmessage(ref const Locloc, const(char)*format, ...);Print a verbose
message. Doesn't prefix or highlight messages.Parameters
Locloclocation of
messageconst(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voidmessage(const(char)*format, ...);Same as above, but doesn't take a location argument.
Parameters
const(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
aliasDiagnosticHandler= bool delegate(ref const(Loc) location, Color headerColor, const(char)* header, const(char)* messageFormat, __va_list_tag* args, const(char)* prefix1, const(char)* prefix2) nothrow;The type of the diagnostic handler see verrorPrint for arguments
Return Value
trueif error handling is done,falseto continue printing to stderr -
Declaration
DiagnosticHandlerdiagnosticHandler;The diagnostic handler. If non-
nullit will be called for every diagnostic message issued by the compiler. If it returnsfalse, the message will be printed to stderr as usual. -
Declaration
nothrow voidtip(const(char)*format, ...);Print a
tipmessage with the prefix and highlighting.Parameters
const(char)*formatprintf-style
formatspecification...printf-style variadic arguments
-
Declaration
nothrow voidverror(ref const Locloc, const(char)*format, va_listap, const(char)*p1= null, const(char)*p2= null, const(char)*header= "Error: ");Same as , but takes a va_list parameter, and optionally additional message prefixes.
Parameters
Locloclocation of error
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
const(char)*p1additional message prefix
const(char)*p2additional message prefix
const(char)*headertitle of error message
-
Declaration
nothrow voidverrorSupplemental(ref const Locloc, const(char)*format, va_listap);Same as , but takes a va_list parameter.
Parameters
Locloclocation of error
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
-
Declaration
nothrow voidvwarning(ref const Locloc, const(char)*format, va_listap);Same as , but takes a va_list parameter.
Parameters
Locloclocation of warning
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
-
Declaration
nothrow voidvwarningSupplemental(ref const Locloc, const(char)*format, va_listap);Same as , but takes a va_list parameter.
Parameters
Locloclocation of warning
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
-
Declaration
nothrow voidvdeprecation(ref const Locloc, const(char)*format, va_listap, const(char)*p1= null, const(char)*p2= null);Same as , but takes a va_list parameter, and optionally additional message prefixes.
Parameters
Locloclocation of deprecation
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
const(char)*p1additional message prefix
const(char)*p2additional message prefix
-
Declaration
nothrow voidvmessage(ref const Locloc, const(char)*format, va_listap);Same as , but takes a va_list parameter.
Parameters
Locloclocation of message
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
-
Declaration
nothrow voidvtip(const(char)*format, va_listap);Same as , but takes a va_list parameter.
Parameters
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
-
Declaration
nothrow voidvdeprecationSupplemental(ref const Locloc, const(char)*format, va_listap);Same as , but takes a va_list parameter.
Parameters
Locloclocation of deprecation
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
-
Declaration
nothrow voidfatal();Call this after printing out
fatalerror messages to clean up and exit the compiler. -
Declaration
nothrow voidhalt();Try to stop forgetting to remove the breakpoints from release builds.
-
Declaration
enumHIGHLIGHT: ubyte;Embed these highlighting commands in the text stream.
HIGHLIGHT.Escape indicates a Color follows.