error-handling: does not show how to deal with errors

Open
#409 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
fsharp, go
Domain
documentation

Research direction

Start by locating the error-handling exercise referenced in this issue and compare it with the Go track exercise described as handling resource errors and cleanup. Define the exercise changes needed to make students handle errors returned or raised by called code, including cleanup, then verify the revised exercise and tests cover those scenarios.

Written by the indexing model from the issue text.

Description

TL;DR: I'm missing in this exercise how to handle exceptions thrown (or anay other kind of error bubble) in code called by me and how to properly clean up then.


This exercises shows me how to use failwith, Option<'T> and Result<'TOk, 'Terror> when I want to return it.

It briefly touches how to deal with a Result that is passed in via the bind function, but not how to deal with a result returned from another function I've called.

But so far nothing new. We have already returned Options and Results earlier in the track, so that is nothing new, we did already pattern matching to unwrap our own types, so thats nothing different than the incomming Result in bind

The only thing that is really new, is that we are asked to dispose some object. But wait, what are objects, how to dispose? What oh, I have to call Dispose() from IDisposable? Whats that? An interface? Aha… Good luck I have heard of thise things in OOP classes already… So just do it…

In my opinion, this exercise would gain a lot, if we actually had to handle real errors instead of just creating them from nothing.

Eg. in the go track, we get some kind of resource which we have to open, close, write to, etc, pp. Depending on the current testcase, it will return an error value or raise a panic, and then the student has to react and close the resource handle, or do a retry, or recover from the panic. Here the student has to actually handle errors that were created elsewhere. Thats an example of the exercise I learnt a lot from…

Dominant language
F#
Stars
118
Forks
113
Avg merge
2d 12h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/fsharp

All issues in exercism/fsharp

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.