Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new Concept Exercise: Error Wrapping #1997

Open
Tracked by #1886
junedev opened this issue Dec 13, 2021 · 2 comments
Open
Tracked by #1886

Implement new Concept Exercise: Error Wrapping #1997

junedev opened this issue Dec 13, 2021 · 2 comments
Labels

Comments

@junedev
Copy link
Member

junedev commented Dec 13, 2021

Getting Started

If you have not yet contributed to concept exercises before, this task requires some upfront reading to acquire the necessary background knowledge.

Here you can read about what Concept Exercises are and how they are structured:

Also be aware of these general guidelines.

Goal

The goal here is to create a new concept exercise that teaches error wrapping. That includes writing a concept and creating a new exercise.

Concepts

The following concept needs to be created. You can use the introduction.md file of the concept also as introduction.md file of the exercise. No need to create different content at this point. Additionally, if you want to save some time it is ok to not have an extensive about.md at this point. It can also be mainly the instruction.md content, maybe with some additions you would like to make.

  • error-wrapping

Learning Objectives

In the concepts the student should learn about the following topics and then practice them in the concept exercise.

  • understanding the error chain
  • how/when to use errors.Is and errors.As
  • how to wrap an error
  • the Unwrap method for custom errors

The about.md file could additionally mention ...

  • how to get a stack strace

We could potentially add some other advanced error topics if there are ideas.

Out of Scope

Prerequisites

  • errors
  • interfaces
  • type-assertions

Other prerequisites should be added as needed to solve the specific exercise.

Story Idea

There is probably no exercise that can be ported directly because Go's error handling is so special but here are some error related exercises from other tracks. The story could maybe be re-used even if we need to change the actual tasks.

Resources

Here some links that might be helpful as a starting point and/or for the links section of the concept:

Implementation Notes

  • The error-wrapping concept folder and config.json entry already exists. No need to create those.
  • For the exercise, there is already a folder deep-thought that should be used and a config.json entry as well. You can rename the exercise folder, the slug and the exercise name to whatever you like, just keep the uuid fixed. You can remove the current content of the "Deep Thought". There was an issue in the past that there were two exercises started that were supposed to teach errors. In the end, one was actually finished up ("The Farm"). If we re-use the uuid of "deep-thought" we don't have to deprecate the exercise and have the "dead" folder lying around. As mentioned before, everything besides the UUID can be safely changed. "Deep Thought" was never finished/live.

How to proceed

  1. First accept this issue by saying "I'd like to work on this" (no need to wait for a response, just go ahead).
  2. Use this issue to discuss any questions you have, what should be included in the content and what not and to collect more reference material.
  3. Create a PR and set "exercism/go" as reviewers. Additionally you can write in #maintaining-go on Slack that your PR is ready for review. Once you incorporated any critical feedback that the reviewer might give you and the PR is approved, it will be merged by a maintainer.
@junedev junedev added help wanted x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept-exercise Work on Concept Exercises x:type/content Work on content (e.g. exercises, concepts) x:size/large Large amount of work labels Dec 13, 2021
@telemachus
Copy link
Contributor

telemachus commented Dec 23, 2021

Two notes (per #2013)

  1. When this lesson is done, the original errors lesson should be edited to include a forward reference to this lesson for more details about errors.
  2. This lesson should include a note that errors.Is is recommended instead of == unless there is a specific reason not to unwrap the error.

See #2013 for background discussion.

@junedev junedev added the x:rep/large Large amount of reputation label Apr 27, 2022
@junedev junedev added on hold and removed help wanted x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept-exercise Work on Concept Exercises x:type/content Work on content (e.g. exercises, concepts) x:size/large Large amount of work x:rep/large Large amount of reputation labels Sep 17, 2022
@junedev
Copy link
Member Author

junedev commented Sep 17, 2022

Putting this on hold because of #2492.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants