Skip to content

Commit 0977892

Browse files
committed
Add warning for network errors
1 parent 39981b3 commit 0977892

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

TranzportMac.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@
9595
AA5C45E11B02835800923BC3 /* Helpers */ = {
9696
isa = PBXGroup;
9797
children = (
98+
AAAC8DE91B04E54100D4D5E9 /* StationFormatter.swift */,
9899
AAC0FF221B029B5E00B320EA /* StartupLaunch.swift */,
99100
AAAC8DE61B04E44600D4D5E9 /* External */,
100-
AAAC8DE91B04E54100D4D5E9 /* StationFormatter.swift */,
101101
);
102102
name = Helpers;
103103
sourceTree = "<group>";

TranzportMac/APIWrapper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class APIWrapper {
1919
let station = defaults.objectForKey("station") as! String
2020
request(.GET, baseURL + "departures", parameters: ["station": station]).responseJSON { (_, _, JSON, error) in
2121
if let err = error {
22-
22+
failure(error: err)
2323
} else {
2424
if let response = JSON as! [[String: AnyObject]]? {
2525
success(departures: Departure.departuresFromArray(response))

TranzportMac/AppDelegate.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
111111
} else {
112112
statusBarItem.title = ""
113113

114-
let noItemsItem = NSMenuItem()
115-
noItemsItem.title = "No departures available for this station"
114+
var noItemsItem = NSMenuItem()
115+
noItemsItem.title = "No departures available"
116+
noItemsItem.action = nil
117+
menu.addItem(noItemsItem)
118+
119+
noItemsItem = NSMenuItem()
120+
noItemsItem.title = "Check station spelling and internet connection"
116121
noItemsItem.action = nil
117-
noItemsItem.keyEquivalent = ""
118122
menu.addItem(noItemsItem)
119123
}
120124

0 commit comments

Comments
 (0)