summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-0/errors.hpp
blob: c052c6926f993f839a253c48b9e986e9e00ce21d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include "ref.hpp"

#include <stdexcept>

namespace intellect {
namespace level0 {

struct no_such_link_type : public std::out_of_range
{
	no_such_link_type(ref source, ref type)
	: std::out_of_range("no such concept link type"),
	  source(source),
	  type(type)
	{ }

	ref const source;
	ref const type;
};

struct no_such_link_type_target : public std::out_of_range
{
	no_such_link_type_target(ref source, ref type, ref target)
	: std::out_of_range("no such concept link type and target"),
	  source(source),
	  type(type),
	  target(type)
	{ }

	ref const source;
	ref const type;
	ref const target;
};

struct link_type_not_unique : public std::invalid_argument
{
	link_type_not_unique(ref source, ref type)
	: std::invalid_argument("more than one such concept link type"),
	  source(source),
	  type(type)
	{ }

	ref const source;
	ref const type;
};

struct still_referenced_by : public std::invalid_argument
{
	still_referenced_by(ref topic, ref referrer)
	: std::invalid_argument("concept is still referenced"),
	  topic(topic),
	  referrer(referrer)
	{ }

	ref const topic;
	ref const referrer;
};

struct no_such_concept : public std::invalid_argument
{
	no_such_concept(ref topic)
	: std::invalid_argument("no such concept reference"),
	  topic(topic)
	{ }

	ref const topic;
};

struct null_reference : public std::invalid_argument
{
	null_reference()
	: std::invalid_argument("null reference")
	{ }
};

}
}