module core.exception

Code Map

module core.exception;


//! Base class of all objects that can be thrown.
class Throwable
{
public:
	msg: string;
	throwLocation: string;
	location: string;


public:
	//! Construct a Throwable object.
	this(msg: string, location: string) { }
}

//! An error that can be handled.
class Exception : Throwable
{
public:
	//! Construct an Exception object.
	this(msg: string, location: string) { }
}

//! An error that cannot be handled.
class Error : Throwable
{
public:
	//! Construct an Error object.
	this(msg: string, location: string) { }
}

//! Thrown if an assert fails.
class AssertError : Error
{
public:
	//! Construct an AssertError object.
	this(msg: string, location: string) { }
}

//! Thrown by the UTF code upon a malformed UTF-8 string.
class MalformedUTF8Exception : Exception
{
public:
	//! Construct a MalformedUTF8Exception object.
	this(msg: string, location: string) { }
}

//! Thrown on an AA lookup failure.
class KeyNotFoundException : Exception
{
public:
	//! Construct a KeyNotFoundException object.
	this(msg: string) { }
}
class Throwable

Base class of all objects that can be thrown.

This should be inherited from, not thrown directly.

this(msg: string, location: string)

Construct a Throwable object.

Parameters

msg

A message describing the error.

location

Where this was thrown from.

class Exception : Throwable

An error that can be handled.

This is one of the two (with Error) classes that user code should inherit from when designing their error handling objects.

this(msg: string, location: string)

Construct an Exception object.

Parameters

msg

A message describing the error.

location

Where this was thrown from.

class Error : Throwable

An error that cannot be handled.

This is one of the two (with Exception) classes that user code should inherit from when designing their error handling objects

this(msg: string, location: string)

Construct an Error object.

Parameters

msg

A message describing the error.

location

Where this was thrown from.

class AssertError : Error

Thrown if an assert fails.

this(msg: string, location: string)

Construct an AssertError object.

Parameters

msg

A message describing the error.

location

Where this was thrown from.

class MalformedUTF8Exception : Exception

Thrown by the UTF code upon a malformed UTF-8 string.

this(msg: string, location: string)

Construct a MalformedUTF8Exception object.

Parameters

msg

A message describing the error.

location

Where this was thrown from.

class KeyNotFoundException : Exception

Thrown on an AA lookup failure.

this(msg: string)

Construct a KeyNotFoundException object.

Parameters

msg

A message describing the error.