# OneNoteFormatException

Exception raised when OneNote binary data violates a required format or safety invariant.

Class 

`OfficeIMO.OneNote`

**Namespace**

`OfficeIMO.OneNote`

**Assembly**

`OfficeIMO.OneNote`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OneNoteDiagnostic.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Diagnostics/OneNoteDiagnostic.cs#L43)

**Base**

`IOException`

**Implements**

`ISerializable`

**Modifiers**

sealed

Exception raised when OneNote binary data violates a required format or safety invariant.

## Inheritance

- IOException
- OneNoteFormatException

Filter members 

Show inherited

## Constructors

`public OneNoteFormatException(string code, string message, long? offset = null, Exception? innerException = null)` [#](#constructor-ctor-string-string-nullable-system-int64-exception)

[OneNoteDiagnostic.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Diagnostics/OneNoteDiagnostic.cs#L43)

Creates a format exception.

Parameters

**code string required**

**message string required**

**offset long? = null optional**

**innerException System.Exception? = null optional**

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual Exception GetBaseException()` [#](#method-getbaseexception)

Inherited from Exception

Returns

`Exception`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public virtual void GetObjectData(SerializationInfo info, StreamingContext context)` [#](#method-getobjectdata-serializationinfo-streamingcontext)

Inherited from Exception

`Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")` `EditorBrowsable(1)`

Parameters

**info SerializationInfo required**

**context StreamingContext required**

`public Type GetType()` [#](#method-gettype)

Inherited from Exception

Returns

`Type`

`public override string ToString()` [#](#method-tostring)

Inherited from Exception

Returns

`string`

## Properties

`public string Code { get; }` [#](#property-code)

[OneNoteDiagnostic.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Diagnostics/OneNoteDiagnostic.cs#L49)

Stable error identifier.

`public long? Offset { get; }` [#](#property-offset)

[OneNoteDiagnostic.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Diagnostics/OneNoteDiagnostic.cs#L52)

Optional zero-based byte offset where the failure was detected.

## Inherited Properties

`public MethodBase? TargetSite { get; }` [#](#property-targetsite)

Inherited from Exception

`public virtual string Message { get; }` [#](#property-message)

Inherited from Exception

`public virtual IDictionary Data { get; }` [#](#property-data)

Inherited from Exception

`public Exception? InnerException { get; }` [#](#property-innerexception)

Inherited from Exception

`public virtual string? HelpLink { get; set; }` [#](#property-helplink)

Inherited from Exception

`public virtual string? Source { get; set; }` [#](#property-source)

Inherited from Exception

`public int HResult { get; set; }` [#](#property-hresult)

Inherited from Exception

`public virtual string? StackTrace { get; }` [#](#property-stacktrace)

Inherited from Exception

<!-- PowerForge markdown artifact sha256:2B29D09ED8C9ECE25B5A9B3C71A4F20F224614689CB14780CBC65A4FC9FC0D03 -->
