Learn how to lay the groundwork for smooth error handling by wrapping the return value of the GetData function in a Choice.Result instance.
- Now that's the exciting bit of it,…but we do as always need to think…about the unhappy part of it that if…for some reason we can't get the data.…So we're going to do a try block around this stuff…and if in accesses some of the external…is obviously always subject to failure…and we're just going to handle all exceptions…and use our good old choice results thing.…Choice dot fail and we're just going…to pass back whatever message there was.…
Now, the reason we got a red squiggly there…is because this branch is returning a prices object…and this branch is returning a choice result object.…So that simply means we need to pipe this branch…into choice dot success, succeed.…Okay, so now, get data takes a query object still…but it returns a choice dot result…of maybe we're going to get prices back…or maybe we're going to get an arrow back…in the form of a string.…
Now, how do we try that out just to prove that it works?…Well, there's a trick to that.…We're going to go to the data project,…and we're going to right-click…
- Defining values and calling functions in F#
- Defining and identifying discriminated unions
- Working with if-else expressions
- Writing unit test
- Using type providers to access data
- Analyzing data with collection functions
- Plotting data using the R type provider
- Using railway-oriented programming to handle errors
- Integrating with Twitter
- Deploying an F# application to Azure
Skill Level Intermediate
1. Get Started with F#
2. Build a Simple Parser with Unit Testing
3. Use F# CSV Type Provider to Get Data
4. Analyze Data with F# Collection Functions
5. Use RStats Provider and ggplot2 to Plot Data
6. Use BoxKite with Twitter
7. Deploy a Working Bot
Next steps1m 46s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.