mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-23 08:17:34 -04:00
handle invalid config
This commit is contained in:
parent
d8baa21e4e
commit
085fbb4769
4 changed files with 6 additions and 1 deletions
|
@ -3,11 +3,12 @@ class_name ConfigBase
|
|||
|
||||
var config: ConfigFile
|
||||
var config_path: String
|
||||
var load_result: Error
|
||||
|
||||
|
||||
func _init(path: String) -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load(path)
|
||||
load_result = config.load(path)
|
||||
config_path = path
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ func load_gate(config_url: String) -> void:
|
|||
if config_path.is_empty(): return error(GateEvents.GateError.NOT_FOUND)
|
||||
|
||||
c_gate = ConfigGate.new(config_path, config_url)
|
||||
if c_gate.load_result != OK: return error(GateEvents.GateError.INVALID_CONFIG)
|
||||
gate_events.gate_config_loaded_emit(config_url, c_gate)
|
||||
|
||||
var image_path = await FileDownloader.download(c_gate.image_url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue