@@ -31,9 +31,13 @@ extension MsgListViewController where Self: UIViewController {
3131
3232 // TODO: uncomment in "sent message from draft" feature
3333 private func openDraft( appContext: AppContextWithUser , with message: Message ) {
34- let controller = ComposeViewController ( appContext: appContext)
35- controller. update ( with: message)
36- navigationController? . pushViewController ( controller, animated: true )
34+ do {
35+ let controller = try ComposeViewController ( appContext: appContext)
36+ controller. update ( with: message)
37+ navigationController? . pushViewController ( controller, animated: true )
38+ } catch {
39+ showAlert ( message: error. localizedDescription)
40+ }
3741 }
3842
3943 private func openMsg( appContext: AppContextWithUser , with message: Message , path: String ) {
@@ -47,13 +51,17 @@ extension MsgListViewController where Self: UIViewController {
4751 }
4852
4953 private func openThread( with thread: MessageThread , appContext: AppContextWithUser ) {
50- let viewController = ThreadDetailsViewController (
51- appContext: appContext,
52- thread: thread
53- ) { [ weak self] ( action, message) in
54- self ? . handleMessageOperation ( with: message, action: action)
54+ do {
55+ let viewController = try ThreadDetailsViewController (
56+ appContext: appContext,
57+ thread: thread
58+ ) { [ weak self] ( action, message) in
59+ self ? . handleMessageOperation ( with: message, action: action)
60+ }
61+ navigationController? . pushViewController ( viewController, animated: true )
62+ } catch {
63+ showAlert ( message: error. localizedDescription)
5564 }
56- navigationController? . pushViewController ( viewController, animated: true )
5765 }
5866
5967 // MARK: Operation
0 commit comments