summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/Shared/LaunchArguments.swift6
1 files changed, 4 insertions, 2 deletions
diff --git a/ios/Shared/LaunchArguments.swift b/ios/Shared/LaunchArguments.swift
index e1f3c0ad41..0fa077f090 100644
--- a/ios/Shared/LaunchArguments.swift
+++ b/ios/Shared/LaunchArguments.swift
@@ -7,7 +7,6 @@
//
import Foundation
-import MullvadTypes
public protocol Taggable {
static var tag: String { get }
@@ -48,7 +47,10 @@ extension Encodable {
public func toJSON(_ encoder: JSONEncoder = JSONEncoder()) throws -> String {
let data = try encoder.encode(self)
guard let result = String(bytes: data, encoding: .utf8) else {
- throw StringDecodingError(data: data)
+ throw EncodingError.invalidValue(
+ self,
+ EncodingError.Context(codingPath: [], debugDescription: "Could not encode self to a utf-8 string")
+ )
}
return result
}