diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index b783eae17..f65459c33 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -635,6 +635,7 @@ // Widget "widget_no_integrations_server_configured" = "No integrations server configured"; +"widget_integrations_server_failed_to_connect" = "Failed to connect to integrations server"; "widget_no_power_to_manage" = "You need permission to manage widgets in this room"; "widget_creation_failure" = "Widget creation has failed"; "widget_sticker_picker_no_stickerpacks_alert" = "You don't currently have any stickerpacks enabled."; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 610984a56..89914b8e9 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -2834,6 +2834,10 @@ internal enum VectorL10n { internal static var widgetIntegrationUnableToCreate: String { return VectorL10n.tr("Vector", "widget_integration_unable_to_create") } + /// Failed to connect to integrations server + internal static var widgetIntegrationsServerFailedToConnect: String { + return VectorL10n.tr("Vector", "widget_integrations_server_failed_to_connect") + } /// No integrations server configured internal static var widgetNoIntegrationsServerConfigured: String { return VectorL10n.tr("Vector", "widget_no_integrations_server_configured") diff --git a/Riot/Managers/Widgets/WidgetManager.h b/Riot/Managers/Widgets/WidgetManager.h index 008a48c19..a15928789 100644 --- a/Riot/Managers/Widgets/WidgetManager.h +++ b/Riot/Managers/Widgets/WidgetManager.h @@ -55,7 +55,8 @@ typedef enum : NSUInteger { WidgetManagerErrorCodeNotEnoughPower, WidgetManagerErrorCodeCreationFailed, - WidgetManagerErrorCodeNoIntegrationsServerConfigured + WidgetManagerErrorCodeNoIntegrationsServerConfigured, + WidgetManagerErrorCodeFailedToConnectToIntegrationsServer } WidgetManagerErrorCode; diff --git a/Riot/Managers/Widgets/WidgetManager.m b/Riot/Managers/Widgets/WidgetManager.m index d10c45995..a6d2bdec1 100644 --- a/Riot/Managers/Widgets/WidgetManager.m +++ b/Riot/Managers/Widgets/WidgetManager.m @@ -548,10 +548,17 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; } } failure:^(NSError *error) { - NSLog(@"[WidgetManager] registerForScalarToken. Error in modular/register request"); + NSLog(@"[WidgetManager] registerForScalarToken: Failed to register. Error: %@", error); if (failure) { + // Specialise the error + NSError *error = [NSError errorWithDomain:WidgetManagerErrorDomain + code:WidgetManagerErrorCodeFailedToConnectToIntegrationsServer + userInfo:@{ + NSLocalizedDescriptionKey: NSLocalizedStringFromTable(@"widget_integrations_server_failed_to_connect", @"Vector", nil) + }]; + failure(error); } }];