This repository was archived by the owner on Sep 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Exceptions
Satakun Utama edited this page May 20, 2021
·
1 revision
Currently, There are 6 Exceptions in StoryScript.
- InvalidSyntax - Something wrong with the Syntax.
- AlreadyDefined - The variable, function, module, or namespace is already defined.
- NotImplementedException - The function or module is not implemented.
- NotDefinedException - The exception, variable, module, namespace, or function does not exist.
- GeneralException - a General Exception. Mostly the Interpreter will never throw this Exception.
- DivideByZeroException - Dividing numbers with zero is not allowed.
- InvalidValue - The input value is invalid.
To throw an Exception, You need to follow this format:
throw [Exception] [Description]
The description is optional. Some Exception has a default Description, And some don't. For example:
throw NotImplementedException
Output:
NotImplementedException: This feature is not implemented
Example 2:
throw AlreadyDefined "This value is already defined!"
Output:
AlreadyDefined: This value is already defined!