# dmd.errors

Functions for raising `errors`.

#### Authors

Walter Bright

#### License

Boost License 1.0

Source: errors.d

Documentation: https://dlang.org/phobos/dmd_errors.html

Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/errors.d

- `Classification`

  #### Declaration

  `enum `Classification`: Color;`

  Color highlighting to classify messages

  - `error`

    #### Declaration

    ``error``

    for errors

  - `gagged`

    #### Declaration

    ``gagged``

    for `gagged` errors

  - `warning`

    #### Declaration

    ``warning``

    for warnings

  - `deprecation`

    #### Declaration

    ``deprecation``

    for deprecations

  - `tip`

    #### Declaration

    ``tip``

    for `tip` messages

- `error`

  #### Declaration

  `nothrow void `error`(const ref Loc `loc`, const(char)* `format`, ...);`

  Print an `error` message, increasing the global `error` count.

  #### Parameters

  `Loc `loc`` | location of `error`
  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `error`

  #### Declaration

  `nothrow void `error`(const(char)* `filename`, uint `linnum`, uint `charnum`, const(char)* `format`, ...);`

  Same as above, but takes a `filename` and line information arguments as separate parameters.

  #### Parameters

  `const(char)* `filename`` | source file of `error`
  `uint `linnum`` | line in the source file
  `uint `charnum`` | column number on the line
  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `errorSupplemental`

  #### Declaration

  `nothrow void `errorSupplemental`(const ref Loc `loc`, const(char)* `format`, ...);`

  Print additional details about an error message. Doesn't increase the error count or print an additional error prefix.

  #### Parameters

  `Loc `loc`` | location of error
  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `warning`

  #### Declaration

  `nothrow void `warning`(const ref Loc `loc`, const(char)* `format`, ...);`

  Print a `warning` message, increasing the global `warning` count.

  #### Parameters

  `Loc `loc`` | location of `warning`
  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `warningSupplemental`

  #### Declaration

  `nothrow void `warningSupplemental`(const ref Loc `loc`, const(char)* `format`, ...);`

  Print additional details about a warning message. Doesn't increase the warning count or print an additional warning prefix.

  #### Parameters

  `Loc `loc`` | location of warning
  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `deprecation`

  #### Declaration

  `nothrow void `deprecation`(const ref Loc `loc`, const(char)* `format`, ...);`

  Print a `deprecation` message, may increase the global warning or error count depending on whether deprecations are ignored.

  #### Parameters

  `Loc `loc`` | location of `deprecation`
  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `deprecationSupplemental`

  #### Declaration

  `nothrow void `deprecationSupplemental`(const ref Loc `loc`, const(char)* `format`, ...);`

  Print additional details about a deprecation message. Doesn't increase the error count, or print an additional deprecation prefix.

  #### Parameters

  `Loc `loc`` | location of deprecation
  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `message`

  #### Declaration

  `nothrow void `message`(const ref Loc `loc`, const(char)* `format`, ...);`

  Print a verbose `message`. Doesn't prefix or highlight messages.

  #### Parameters

  `Loc `loc`` | location of `message`
  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `message`

  #### Declaration

  `nothrow void `message`(const(char)* `format`, ...);`

  Same as above, but doesn't take a location argument.

  #### Parameters

  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `DiagnosticHandler`

  #### Declaration

  `alias `DiagnosticHandler` = 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

  `true` if error handling is done, `false` to continue printing to stderr

- `diagnosticHandler`

  #### Declaration

  `DiagnosticHandler `diagnosticHandler`;`

  The diagnostic handler. If non-`null` it will be called for every diagnostic message issued by the compiler. If it returns `false`, the message will be printed to stderr as usual.

- `tip`

  #### Declaration

  `nothrow void `tip`(const(char)* `format`, ...);`

  Print a `tip` message with the prefix and highlighting.

  #### Parameters

  `const(char)* `format`` | printf-style `format` specification
  `...` | printf-style variadic arguments

- `verror`

  #### Declaration

  `nothrow void `verror`(const ref Loc `loc`, const(char)* `format`, va_list `ap`, 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

  `Loc `loc`` | location of error
  `const(char)* `format`` | printf-style `format` specification
  `va_list `ap`` | printf-style variadic arguments
  `const(char)* `p1`` | additional message prefix
  `const(char)* `p2`` | additional message prefix
  `const(char)* `header`` | title of error message

- `verrorSupplemental`

  #### Declaration

  `nothrow void `verrorSupplemental`(const ref Loc `loc`, const(char)* `format`, va_list `ap`);`

  Same as , but takes a va_list parameter.

  #### Parameters

  `Loc `loc`` | location of error
  `const(char)* `format`` | printf-style `format` specification
  `va_list `ap`` | printf-style variadic arguments

- `vwarning`

  #### Declaration

  `nothrow void `vwarning`(const ref Loc `loc`, const(char)* `format`, va_list `ap`);`

  Same as , but takes a va_list parameter.

  #### Parameters

  `Loc `loc`` | location of warning
  `const(char)* `format`` | printf-style `format` specification
  `va_list `ap`` | printf-style variadic arguments

- `vwarningSupplemental`

  #### Declaration

  `nothrow void `vwarningSupplemental`(const ref Loc `loc`, const(char)* `format`, va_list `ap`);`

  Same as , but takes a va_list parameter.

  #### Parameters

  `Loc `loc`` | location of warning
  `const(char)* `format`` | printf-style `format` specification
  `va_list `ap`` | printf-style variadic arguments

- `vdeprecation`

  #### Declaration

  `nothrow void `vdeprecation`(const ref Loc `loc`, const(char)* `format`, va_list `ap`, const(char)* `p1` = null, const(char)* `p2` = null);`

  Same as , but takes a va_list parameter, and optionally additional message prefixes.

  #### Parameters

  `Loc `loc`` | location of deprecation
  `const(char)* `format`` | printf-style `format` specification
  `va_list `ap`` | printf-style variadic arguments
  `const(char)* `p1`` | additional message prefix
  `const(char)* `p2`` | additional message prefix

- `vmessage`

  #### Declaration

  `nothrow void `vmessage`(const ref Loc `loc`, const(char)* `format`, va_list `ap`);`

  Same as , but takes a va_list parameter.

  #### Parameters

  `Loc `loc`` | location of message
  `const(char)* `format`` | printf-style `format` specification
  `va_list `ap`` | printf-style variadic arguments

- `vtip`

  #### Declaration

  `nothrow void `vtip`(const(char)* `format`, va_list `ap`);`

  Same as , but takes a va_list parameter.

  #### Parameters

  `const(char)* `format`` | printf-style `format` specification
  `va_list `ap`` | printf-style variadic arguments

- `vdeprecationSupplemental`

  #### Declaration

  `nothrow void `vdeprecationSupplemental`(const ref Loc `loc`, const(char)* `format`, va_list `ap`);`

  Same as , but takes a va_list parameter.

  #### Parameters

  `Loc `loc`` | location of deprecation
  `const(char)* `format`` | printf-style `format` specification
  `va_list `ap`` | printf-style variadic arguments

- `FatalErrorHandler`

  #### Declaration

  `alias `FatalErrorHandler` = bool delegate() nothrow;`

  The type of the fatal error handler

  #### Return Value

  `true` if error handling is done, `false` to do exit(EXIT_FAILURE)

- `fatalErrorHandler`

  #### Declaration

  `FatalErrorHandler `fatalErrorHandler`;`

  The fatal error handler. If non-`null` it will be called for every fatal() call issued by the compiler.

- `fatal`

  #### Declaration

  `nothrow void `fatal`();`

  Call this after printing out `fatal` error messages to clean up and exit the compiler. You can also set a fatalErrorHandler to override this behaviour.

- `halt`

  #### Declaration

  `nothrow void `halt`();`

  Try to stop forgetting to remove the breakpoints from release builds.

- `HIGHLIGHT`

  #### Declaration

  `enum `HIGHLIGHT`: ubyte;`

  Embed these highlighting commands in the text stream. `HIGHLIGHT`.Escape indicates a Color follows.