TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class TinmanException in Tinman.Core

This is the base exception class of the Tinman Library.

class TinmanException extends Exception
  base of ConfigException
  FailedAssertionException
  GeorefException
  InvalidArgumentException
  IOException
  LicenceException
  PoolingException
  RenderException
  ValidatingException

Remarks

When an instance of TinmanException (and not one of its subclasses) is thrown, this means that an unexpected error has occurred. An application may catch such errors and try to continue, consuming the provided error information, for example by creating a problem report.

Subclasses of TinmanException are used to distinguish between error types that an application can respond to by catching specific exception types only. Low-level error information is provided using TinmanError objects. Subclasses may also provide additional error information, on a higher application level.

The following exceptions are thrown in DEBUG mode only and indicate programming mistakes. These exceptions are not included in the list of thrown exceptions in the documentation of a method; instead, the preconditions and assertions are explained.

These exceptions represent expected error situations which are thrown in both DEBUG and RELEASE mode (dependent libraries may define additional exception types): Panic situations (i.e. fatal internal errors) are reported via Panic. Obviously, this should never happen. But if it does anyway, the reported information can be used to file a bug report (please send to: support@tinman3d.com). Information may be found in log output (see LoggingUtil), in error dump file (see TinmanErrorDump) or exception messages.

Protected / Attributes

NeedsStacktrace

Include a stack-trace in ErrorInfo?

protected virtual property NeedsStacktrace { get }
type bool
value true to include a stack-trace, false to omit it.

Protected / Constructors

TinmanException

Creates a new exception.

protected constructor TinmanException (string source, string message, TinmanError cause = null)
params source The error source (see ErrorSource).
  message The error message.
  cause Optional error cause. Defaults to null.

Protected / Methods

FetchLastError

Fetches the OS error code of the last operation.

protected static method FetchLastError ()
type int32
returns The OS error code.

Public / Attributes

ErrorInfo

The TinmanError object that describes the error that has occurred.

public property ErrorInfo { get }
type TinmanError
value [not-null] The TinmanError object.

Message

Returns the human-readable exception message.

[Pure]
public override sealed property Message { get }
type string
value [not-null] The localized exception message.
overrides Exception.Message

Source

The error source (see ErrorSource).

public property Source { get }
type string
value The error source tag.

Public / Constructors

Error

An unexpected error has occurred.

public static method Error (string source, string message = null, TinmanError errorInfo = null)
type TinmanException
params source The error source (see ErrorSource).
  message The error message.
  errorInfo The error cause.
returns The ready-to-throw exception.

NativeError

A native function call has failed although it was expected to succeed.

public static method NativeError (string source, string functionName)
type TinmanException
params source The error source (see ErrorSource).
  functionName The function name.
returns The ready-to-throw exception.

Remarks:

The error code is retrieved via FetchLastError.

See also:

NativeErrorMessage

A native function call has failed although it was expected to succeed.

public static method NativeError (string source, string functionName, int32 errorCode)
type TinmanException
params source The error source (see ErrorSource).
  functionName The function name.
  errorCode The native error code.
returns The ready-to-throw exception.

See also:

NativeErrorMessage

A native function call has failed although it was expected to succeed.

public static method NativeError (string source, string functionName, string errorCode)
type TinmanException
params source The error source (see ErrorSource).
  functionName The function name.
  errorCode The native error code.
returns The ready-to-throw exception.

See also:

NativeErrorMessage

Public / Methods

NativeErrorMessage

Generates an error message for NativeError.

[Pure]
public static method NativeErrorMessage (string functionName)
type string
params functionName The function name.
returns [not-empty] The error message.

Generates an error message for NativeError.

[Pure]
public static method NativeErrorMessage (string functionName, int32 errorCode)
type string
params functionName The function name.
  errorCode The native error code.
returns [not-empty] The error message.

Generates an error message for NativeError.

[Pure]
public static method NativeErrorMessage (string functionName, string errorCode)
type string
params functionName The function name.
  errorCode The native error code.
returns [not-empty] The error message.

Panic

A panic situation has occurred.

public static method Panic (string source, string message = null)
params source The error source (see ErrorSource).
  message The panic message. Defaults to null.

Remarks:

A panic is an unrecoverable problem usually caused by programming errors at development time that are reported by throwing an exception in DEBUG mode. In RELEASE mode, panic handling is platform dependent, to allow more aggressive code optimizations (e.g. noexcept in C++):

For the RELEASE mode case, dummy code is in place to make the compiler happy. Dummy code should be as simple as possible, for example a single return or use of default values. It is assumed that dummy code will never be executed.

See also:

PanicHandler

Panic_ShouldNeverHappen

This code path will never be executed; static code analysis may fail to detect this, but the developer (hopefully) knows better.

public static method Panic_ShouldNeverHappen (string source, TinmanException exception)
params source The error source (see ErrorSource).
  exception The impossible exception that has been caught.

Remarks:

This factory method is only used to satisfy coding guidelines and to make the compiler happy.

Panic_UnknownEnum

A panic situation has occurred (unknown enum item).

public static method Panic_UnknownEnum (string source, string name, string ordinal)
params source The error source (see ErrorSource).
  name Name of the enumeration.
  ordinal The ordinal number of the enumeration item.
returns The ready-to-throw exception.

See also:

Panic

A panic situation has occurred (unknown enum item).

public static method Panic_UnknownEnum (string source, string name, int32 ordinal)
params source The error source (see ErrorSource).
  name Name of the enumeration.
  ordinal The ordinal number of the enumeration item.
returns The ready-to-throw exception.

See also:

Panic

PanicHandler

Optionally, a panic handler may be specified which will be called in a panic situation, instead of performing the default behaviour as described for Panic.

public static method PanicHandler (PanicDelegate handler)
params handler The panic handle or null to use the default behaviour.

ToString

Returns a textual representation of this exception.

[Pure]
public override sealed method ToString ()
type string
returns [not-empty] The localized textual representation.
overrides Exception.ToString