Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions core/Extensions/Lwk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ extension LwkError {
switch self {
case .Generic(msg: let msg):
return msg.replacingOccurrences(of: "BoltzApi(HTTP(\"\\\"", with: "").replacingOccurrences(of: "\\\"\"))", with: "")
case .PoisonError(msg: let msg):
return "Poison Error \(msg)"
case .PoisonError(msg: _):
return "An internal error occurred. Please try again or contact support."
case .MagicRoutingHint(_, _, _):
return "Magic Routing Hint"
return "A routing error occurred. Please try again."
case .SwapExpired(_, _):
return "Swap Expired"
return "This swap has expired. Please start a new one."
case .NoBoltzUpdate:
return "No Boltz Update"
return "The swap service is not responding. Please try again later."
case .ObjectConsumed:
return "Object Consumed"
case .BoltzBackendHttpError(status: let status, error: let error):
return "Http error \(status): \(error ?? "")"
return "An internal error occurred. Please restart the app and try again."
case .BoltzBackendHttpError(status: let status, error: _):
return "A server error occurred (code \(status)). Please try again later."
}
}
}
Expand Down
32 changes: 16 additions & 16 deletions gaios/Extensions/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ extension Error {
case HWError.Abort(let txt), HWError.Declined(let txt):
return txt
case HWError.Disconnected(_):
return "id_disconnect"
return "id_your_device_was_disconnected"
case .URLError:
return "id_invalid_url"
case .InvalidResponse:
return "Invalid Response"
return "id_invalid_response"
case .NoNewFirmwareFound:
return "Firmware up to date"
return "id_firmware_up_to_date"
case .Rebooted(_):
return "Device rebooted, waiting to reconnect"
return "id_device_rebooted_reconnecting"
}
}
if let swError = self as? BleLedgerConnection.SWError {
Expand All @@ -50,7 +50,7 @@ extension Error {
case LoginError.hostUnblindingDisabled(let txt):
return txt ?? "id_operation_failure"
case LoginError.walletMismatch( _):
return "Wallet mismatch"
return "id_wallet_mismatch"
case LoginError.walletsJustRestored(_):
return "id_wallet_already_restored"
case LoginError.invalidMnemonic(_):
Expand All @@ -60,15 +60,15 @@ extension Error {
if let gdkError = self as? GaError {
switch gdkError {
case GaError.NotAuthorizedError:
return "Not Authorized Error"
return "id_not_authorized"
case GaError.GenericError(let txt):
return txt ?? "id_operation_failure"
case .ReconnectError:
return "Reconnect Error"
return "id_reconnect_error"
case .SessionLost:
return "Session Error"
return "id_session_expired"
case .TimeoutError:
return "Timeout Error"
return "id_timeout"
}
}
if let resolverError = self as? TwoFactorCallError {
Expand All @@ -90,28 +90,28 @@ extension Error {
}
}
if let breezError = self as? BreezSDK.SdkError {
return breezError.description() ?? "Sdk error"
return breezError.description() ?? "id_operation_failure"
}
if let breezError = self as? BreezSDK.SendOnchainError {
return breezError.description() ?? "Send onchain error"
return breezError.description() ?? "id_operation_failure"
}
if let breezError = self as? BreezSDK.SendPaymentError {
return breezError.description() ?? "Send payment error"
return breezError.description() ?? "id_operation_failure"
}
if let breezError = self as? BreezSDK.ReceiveOnchainError {
return breezError.description() ?? "Receive onchain error"
return breezError.description() ?? "id_operation_failure"
}
if let breezError = self as? BreezSDK.ReceivePaymentError {
return breezError.description() ?? "Receive payment error"
return breezError.description() ?? "id_operation_failure"
}
if let breezError = self as? BreezSDK.LnUrlPayError {
return breezError.description() ?? "id_operation_failure"
}
if let breezError = self as? BreezSDK.LnUrlAuthError {
return breezError.description() ?? "LN url auth error"
return breezError.description() ?? "id_operation_failure"
}
if let breezError = self as? BreezSDK.ConnectError {
return breezError.description() ?? "Connection error"
return breezError.description() ?? "id_connection_failed"
}
if let error = self as? LwkError {
return error.description()
Expand Down
6 changes: 3 additions & 3 deletions gaios/Sendflow/Flow/Error/SendFlowError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ enum SendFlowError: Error, Sendable, Equatable {
case .invalidPaymentTarget:
return "id_invalid_address"
case .failedToBuildTransaction:
return "Failed to build transaction"
return "id_failed_to_build_transaction"
case .wrongSubaccount:
return "id_invalid_address"
case .wrongAssetId(let ticker):
return "Payment URI is for \(ticker)."
case .insufficientFunds:
return "id_insufficient_funds"
case .invalidSession:
return "Invalid session"
return "id_invalid_session"
case .generic(let msg):
return msg.localized
case .serviceUnavailable:
return "Service temporary unavailable"
return "id_service_temporarily_unavailable"
case .gdkError(let msg):
return msg.localized
case .invalidAmount(let msg):
Expand Down
Loading