]> ocean-lang.org Git - ocean-D/blobdiff - Ocean-errors
updates
[ocean-D] / Ocean-errors
index b677b866ad5e3abc4fee904a1c427345e809c770..0141be278d49c32d76ca6ff3b8d5ed89dd34be1b 100644 (file)
@@ -10,3 +10,20 @@ I want things to be able to throw errors - or fail-safe(?)
  when they aren't caught.
 
  I could have an 'else' on any simple statement which does error handling
+
+
+Maybe a type that starts '?' can fail to have a value.
+
+foo: ?int
+
+ foo = 27/0
+
+ would not trigger an error, but you need
+   if ?foo: print foo; else print "div by zero"
+ to use the value
+
+ Most operators will let an error fall through if it is expected.
+
+ If you want details about the error, you need to declare a type that
+ holds a value or an error.  You then get the error code with foo.err or whatever 
+ you have defined.