improve throw info

This commit is contained in:
Beu
2024-12-18 17:03:10 +01:00
parent ab3463fa16
commit 850968100e
3 changed files with 7 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ class InterfacesConfig {
Layers.InsertLast(LayerConfig); Layers.InsertLast(LayerConfig);
} catch { } catch {
warn("Can't load layer \""+ i +"\" of Interface Config: \""+ Name +"\""); warn("Can't load layer \""+ i +"\" of Interface Config: \""+ Name +"\"\nException Message: " + getExceptionInfo());
} }
} }
} }

View File

@@ -13,6 +13,10 @@ class LayerConfig {
const string Manialink = GetManialink(); const string Manialink = GetManialink();
Name = InterfacesManager::GetLayerName(Manialink); Name = InterfacesManager::GetLayerName(Manialink);
if (Name.Length == 0) {
throw('Can\'t find Manialink name');
}
if (_Data.HasKey('LayerType') && _Data['LayerType'].GetType() == Json::Type::String) { if (_Data.HasKey('LayerType') && _Data['LayerType'].GetType() == Json::Type::String) {
LayerType = CastEUILayerType(_Data['LayerType']); LayerType = CastEUILayerType(_Data['LayerType']);
} }
@@ -24,7 +28,7 @@ class LayerConfig {
string GetManialink() const { string GetManialink() const {
if (!IO::FileExists(Path)) { if (!IO::FileExists(Path)) {
throw('Invalid Layer: Can\'t find "' + Path + '"'); throw('File doesn\'t exists: "'+ Path +'"');
} }
IO::File File(Path, IO::FileMode::Read); IO::File File(Path, IO::FileMode::Read);

View File

@@ -46,7 +46,7 @@ namespace InterfacesManager {
const InterfacesConfig Config(Path, FileContent); const InterfacesConfig Config(Path, FileContent);
G_Configs[Id] = Config; G_Configs[Id] = Config;
} catch { } catch {
warn('Invalid Interface Config: "' + Path + '" is an invalid json'); warn('Invalid Interface Config: "'+ Path +'" is an invalid\nException Message: '+ getExceptionInfo());
} }
} }