twitch addon
This commit is contained in:
parent
2cd7af98a1
commit
07de7179c9
254 changed files with 18420 additions and 1 deletions
32
addons/very-simple-twitch/vst_error.gd
Normal file
32
addons/very-simple-twitch/vst_error.gd
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class_name VSTError
|
||||
|
||||
enum VSTCodeError {PARAM_ERROR, TIMEOUT_ERROR, NETWORK_ERROR, SERVER_ERROR}
|
||||
|
||||
var code: VSTCodeError
|
||||
var description: String
|
||||
var info: String
|
||||
|
||||
func _init(error_code: VSTCodeError, error_info: String = ""):
|
||||
code = error_code
|
||||
info = error_info
|
||||
description = _get_description_from_code(error_code)
|
||||
|
||||
|
||||
func _get_description_from_code(error_code: VSTCodeError) -> String:
|
||||
var result = ""
|
||||
match (error_code):
|
||||
VSTCodeError.PARAM_ERROR:
|
||||
result = "The request aren't fullfilled properly. Check the data"
|
||||
VSTCodeError.NETWORK_ERROR:
|
||||
result = "The request result in an error"
|
||||
VSTCodeError.SERVER_ERROR:
|
||||
result = "There is an error in server"
|
||||
VSTCodeError.TIMEOUT_ERROR:
|
||||
result = "The server doesn't response"
|
||||
_:
|
||||
result = "Unknown error"
|
||||
return result
|
||||
|
||||
|
||||
func _to_string():
|
||||
return "%s %s %s" % [str(code), description, info]
|
||||
Loading…
Add table
Add a link
Reference in a new issue