diff --git a/ProjectClock/AccountViewController.swift b/ProjectClock/AccountViewController.swift index e26527a..1d4e0dd 100644 --- a/ProjectClock/AccountViewController.swift +++ b/ProjectClock/AccountViewController.swift @@ -104,8 +104,9 @@ class LoginVC: UIViewController } err: { - print($0) - a.dismiss { self.msg("An error occurred", "Maybe the server is on fire, just wait a few hours.") } + let messages = ["409 - [\"A0111\"]":"Account already exists, please login instead."] + let message = messages[$0] ?? "Maybe the server is on fire, just wait a few hours." + a.dismiss { self.msg("An error occurred", message) } } } diff --git a/ProjectClock/Utils.swift b/ProjectClock/Utils.swift index 2940048..90ad1c6 100644 --- a/ProjectClock/Utils.swift +++ b/ProjectClock/Utils.swift @@ -139,7 +139,7 @@ extension UIViewController func msg(_ title: String, _ message: String) -> UIAlertController { alert(title, message, okayable: true) } /// More convenient dismiss function - func dismiss(_ completion: (() -> Void)? = nil) { ui { dismiss(animated: false, completion: completion) } } + func dismiss(_ completion: (() -> Void)? = nil) { ui { self.dismiss(animated: false, completion: completion) } } }