Last active
September 21, 2015 04:47
-
-
Save macbaszii/858321613db8c9583b74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| do { | |
| try canPurchaseItem(specificItem, forUser: specificUser) | |
| } catch PurchaseError.OutOfStockItem { | |
| print("The Item is out of stock") | |
| } catch PurchaseError.InsufficientFunds { | |
| print("Your money is insufficient to buy this item") | |
| } | |
| // In case that you make sure the function always doesn't throw the error | |
| try! canPurchaseItem(specificItem, forUser: specificUser) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment