dmd.errors
Functions for raising errors.
License
Source: errors.d
Documentation: https://dlang.org/phobos/dmd_errors.html
-
Declaration
enumErrorKind: int;Constants used to discriminate kinds of error messages.
-
Declaration
classErrorSinkCompiler: dmd.errorsink.ErrorSink;Error message sink for D compiler.
-
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(const ref 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(const ref 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(const ref 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(const ref 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(const ref 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(const ref 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(const ref 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 verrorReport 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 voidverrorReport(const ref Locloc, const(char)*format, va_listap, ErrorKindkind, const(char)*p1= null, const(char)*p2= null);Implements , , , , and . Report a diagnostic error, taking a va_list parameter, and optionally additional message prefixes. Whether the message gets printed depends on runtime values of DiagnosticReporting and global gagging.
Parameters
Locloclocation of error
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
ErrorKindkindkindof error being printedconst(char)*p1additional message prefix
const(char)*p2additional message prefix
-
Declaration
nothrow voidverrorReportSupplemental(const ref Locloc, const(char)*format, va_listap, ErrorKindkind);Implements , , and . Report an addition diagnostic error, taking a va_list parameter. Whether the message gets printed depends on runtime values of DiagnosticReporting and global gagging.
Parameters
Locloclocation of error
const(char)*formatprintf-style
formatspecificationva_listapprintf-style variadic arguments
ErrorKindkindkindof error being printed -
Declaration
aliasFatalErrorHandler= bool delegate() nothrow;The type of the fatal error handler
Return Value
trueif error handling is done,falseto do exit(EXIT_FAILURE) -
Declaration
FatalErrorHandlerfatalErrorHandler;The fatal error handler. If non-
nullit will be called for every fatal() call issued by the compiler. -
Declaration
nothrow voidfatal();Call this after printing out
fatalerror messages to clean up and exit the compiler. You can also set a fatalErrorHandler to override this behaviour. -
Declaration
nothrow @safe 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.