HeaderMismatchException

Exception thrown under different conditions based on the type of Contents.

Structure, Class, and Associative Array

  • When a header is provided but a matching column is not found

Other

  • When a header is provided but a matching column is not found
  • Order did not match that found in the input

Since a row and column is not meaningful when a column specified by the header is not found in the data, both row and col will be zero. Otherwise row is always one and col is the first instance found in header that occurred before the previous starting at one.

class HeaderMismatchException : CSVException {}

Mixed In Members

From mixin basicExceptionCtors

this
this(string msg, string file, size_t line, Throwable next)
this
this(string msg, Throwable next, string file, size_t line)

Inherited Members

From CSVException

row
size_t row;
col
size_t col;

Examples

import std.exception : assertThrown;
string text = "a,b,c\nHello,65,2.5";
assertThrown!HeaderMismatchException(text.csvReader(["b","c","invalid"]));

Meta