summaryrefslogtreecommitdiff
path: root/intellect-framework-from-internet/starts/meaning-vm/level-0/errors.hpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-10 14:56:27 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-10 14:56:27 -0800
commit26c980d302adce8e3d802cb8db8ab1c69d58ce1a (patch)
treee296225f17370c9e472660396b3a51539f76ff28 /intellect-framework-from-internet/starts/meaning-vm/level-0/errors.hpp
parent2e01fed206e46a669ba56f57b4b943cfe661a0f1 (diff)
parentc8bb547bea279af2bb48c13260f98aa8add07131 (diff)
downloadstandingwithresilience-26c980d302adce8e3d802cb8db8ab1c69d58ce1a.tar.gz
standingwithresilience-26c980d302adce8e3d802cb8db8ab1c69d58ce1a.zip
Merge branch 'intellect-framework-from-internet'
Diffstat (limited to 'intellect-framework-from-internet/starts/meaning-vm/level-0/errors.hpp')
-rw-r--r--intellect-framework-from-internet/starts/meaning-vm/level-0/errors.hpp101
1 files changed, 101 insertions, 0 deletions
diff --git a/intellect-framework-from-internet/starts/meaning-vm/level-0/errors.hpp b/intellect-framework-from-internet/starts/meaning-vm/level-0/errors.hpp
new file mode 100644
index 0000000..e599261
--- /dev/null
+++ b/intellect-framework-from-internet/starts/meaning-vm/level-0/errors.hpp
@@ -0,0 +1,101 @@
+#pragma once
+#include "concept.hpp"
+
+#include <stdexcept>
+
+namespace intellect {
+namespace level0 {
+
+struct no_such_link_type : public std::out_of_range
+{
+ no_such_link_type(concept* source, concept* type)
+ : std::out_of_range("no such concept link type"),
+ source(source),
+ type(type)
+ { }
+
+ concept* const source;
+ concept* const type;
+};
+
+struct no_such_link_type_target : public std::out_of_range
+{
+ no_such_link_type_target(concept* source, concept* type, concept* target)
+ : std::out_of_range("no such concept link type and target"),
+ source(source),
+ type(type),
+ target(type)
+ { }
+
+ concept* const source;
+ concept* const type;
+ concept* const target;
+};
+
+struct crucial_link_type_target : public std::out_of_range
+{
+ crucial_link_type_target(concept* source, concept* type, concept* target)
+ : std::out_of_range("concept part is crucial"),
+ source(source),
+ type(type),
+ target(type)
+ { }
+
+ concept* const source;
+ concept* const type;
+ concept* const target;
+};
+
+struct crucial_concept : public std::invalid_argument
+{
+ crucial_concept(concept* topic)
+ : std::invalid_argument("concept is crucial"),
+ topic(topic)
+ { }
+
+ concept* const topic;
+};
+
+struct link_type_not_unique : public std::invalid_argument
+{
+ link_type_not_unique(concept* source, concept* type)
+ : std::invalid_argument("more than one such concept link type"),
+ source(source),
+ type(type)
+ { }
+
+ concept* const source;
+ concept* const type;
+};
+
+struct still_referenced_by : public std::invalid_argument
+{
+ still_referenced_by(concept* topic, concept* referrer)
+ : std::invalid_argument("concept is still referenced"),
+ topic(topic),
+ referrer(referrer)
+ { }
+
+ concept* const topic;
+ concept* const referrer;
+};
+
+struct no_such_concept : public std::invalid_argument
+{
+ no_such_concept(concept* topic)
+ : std::invalid_argument("no such concept reference"),
+ topic(topic)
+ { }
+
+ concept* const topic;
+};
+
+struct null_reference : public std::invalid_argument
+{
+ null_reference()
+ : std::invalid_argument("null reference")
+ { }
+};
+
+}
+}