BubbleLang/Error
When you try to execute an illegal command, BubbleLang returns an error.
SyntaxError
Default
print("So what does "pneumonoultramicroscopicsilicovolcanoconiosis" meaning?")
In this case, the results we hope to get is So what does "pneumonoultramicroscopicsilicovolcanoconiosis" meaning?
, but the word "pneumonoultramicroscopicsilicovolcanoconiosis" is not in any string, and BubbleLang didn't has the command "pneumonoultramicroscopicsilicovolcanoconiosis", so it will output:
[Error 1]SyntaxError.Default: Invalid Syntax
Assignment
var True = "真"
In this case, we're trying to assign to a variable called "True", but "True" is the keyword of BubbleLang, so it will output:
[Error 2]SyntaxError.Assignment: Can't assign to a keyword
NameError
Default
var a = 114514 print(b)
In this case, we're trying to access a variable called "b", but BubbleLang didn't found "b", so it will output:
[Error 3]NameError.Default: Name "b" is not undefined
ValueError
List
var mylist = ["A", "N", "P", "M"] mylist.remove("T")
In this case, we're trying to remove the element "T" from the list "my_list", but "T" is not an element of this list, so it will output:
[Error 4]ValueError.List: Element ""T"" is not in the list
Convert
var string = "b185091-2" string = int(string)
In this case, we're tring to convert "b185091-2" to integer, but there are some illegal things in the string, so it will output:
[Error 5]ValueError.Convert: Illegal literal to convert to int: "b185091-2"
CalculationError
ZeroDivision
var t = 5 var w = 0 print(t/w)
In this case, we're trying divide 5 by 0, but mathematic didn't defines that n÷0, so it will output:
[Error 6]CalculationError.Zerodivision: Division by 0
OutOfRange
from math import * var x: float = 2 print(arcsin(x))
In this case, we're trying to get the sin-1(2), but sin-1(x) in BubbleLang is only defined for [-1,1], so it will output:
[Error 7]CalculationError.OutOfRange: arcsin(x) only works for the real number between -1 and 1
FileError
NotFound
filename = "s.txt" with open(filename, "r"): print(filename.content())
In this case, we're trying access s.txt, but s.txt is not in this workspace directory, so it will output:
[Error 8]FileError.NotFound: [WinError 2](The system could not find the specified file.): "s.txt"
Others
I'll add them soon.