View source code
Display the source code in std/csv.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Class std.csv.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.
Fields
Name | Type | Description |
---|---|---|
col
|
ulong | |
file
|
string | The file name of the D source code corresponding with where the error was thrown from. |
info
|
object | The stack trace of where the error happened. This is an opaque object
that can either be converted to string , or iterated over with foreach to extract the items in the stack trace (as strings).
|
line
|
ulong | The line number of the D source code corresponding with where the error was thrown from. |
msg
|
string | A message describing the error. |
row
|
ulong |
Properties
Name | Type | Description |
---|---|---|
next [get]
|
inout(Throwable) | |
next [set]
|
Throwable | Replace next in chain with tail .
Use chainTogether instead if at all possible.
|
Methods
Name | Description |
---|---|
chainTogether
(e1, e2)
|
Append e2 to chain of exceptions that starts with e1 .
|
factory
(classname)
|
Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor. |
message
()
|
Get the message describing the error.
Base behavior is to return the Throwable field.
Override to return some other error message.
|
opApply
(dg)
|
Loop over the chain of Throwables. |
opCmp
(o)
|
Compare with another Object obj. |
opEquals
(o)
|
Test whether this is equal to o .
The default implementation only compares by identity (using the is operator).
Generally, overrides for opEquals should attempt to compare objects by their contents.
|
refcount
()
|
|
toHash
()
|
Compute hash function for Object. |
toString
()
|
Overrides Object and returns the error message.
Internally this forwards to the toString overload that
takes a sink delegate.
|
toString
()
|
The Throwable hierarchy uses a toString overload that takes a
sink delegate to avoid GC allocations, which cannot be
performed in certain error situations. Override this toString method to customize the error message.
|
Example
import std .exception : assertThrown;
string text = "a,b,c\nHello,65,2.5";
assertThrown!HeaderMismatchException(text .csvReader(["b","c","invalid"]));
Authors
Jesse Phillips
License
Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.