summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-0/errors.hpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-24 13:22:55 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-24 13:22:55 -0800
commit9a14918abec434d8463e07635daef380ad630649 (patch)
treefa1a5200da88ad6065092b05dc063a8a80df8faa /starts/meaning-vm/level-0/errors.hpp
parent50be8bb8697b23ff469de142eaebe9666c2a9537 (diff)
downloadstandingwithresilience-9a14918abec434d8463e07635daef380ad630649.tar.gz
standingwithresilience-9a14918abec434d8463e07635daef380ad630649.zip
breaking into levels
Diffstat (limited to 'starts/meaning-vm/level-0/errors.hpp')
-rw-r--r--starts/meaning-vm/level-0/errors.hpp77
1 files changed, 77 insertions, 0 deletions
diff --git a/starts/meaning-vm/level-0/errors.hpp b/starts/meaning-vm/level-0/errors.hpp
new file mode 100644
index 0000000..c052c69
--- /dev/null
+++ b/starts/meaning-vm/level-0/errors.hpp
@@ -0,0 +1,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")
+ { }
+};
+
+}
+}