Table of Contents

Class KeyFormatException

Namespace
DynaSharp
Assembly
DynaSharp.dll

A value cannot be part of a key: it is empty, contains a delimiter that its format does not take, a control character or U+10FFFF, is not well-formed text, or does not fit its numeric or timestamp format. It is an ArgumentException, so a key built from user input fails as a bad argument.

public sealed class KeyFormatException : ArgumentException, ISerializable
Inheritance
KeyFormatException
Implements
Inherited Members

Remarks

The message and ParamName name the placeholder and never the value, because keys are often built from user input and exceptions end up in logs. From a generated key builder the message names the template as well, as it is written in the code, and for a delimiter the delimiters of the template, but not which of them the value holds: The value contains a delimiter of the key template 'USER#{Id}' ('#').

Constructors

KeyFormatException(string)

Initializes a new instance of the KeyFormatException class for text that does not match a key template.

public KeyFormatException(string message)

Parameters

message string

What is wrong. Must not contain the key or a value of it.

KeyFormatException(string, string)

Initializes a new instance of the KeyFormatException class for a value of a placeholder.

public KeyFormatException(string placeholder, string reason)

Parameters

placeholder string

The name of the placeholder, also reported as ParamName.

reason string

What is wrong with the value. Must not contain the value.