Skip to content

[V3] Implement new Concept Exercise: errors #949

@SleeplessByte

Description

@SleeplessByte

This issue describes how to implement the errors concept exercise for the javascript track.

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Please also watch the following video:

See the documentation above (general documentation), as well as How to implement a Concept Exercise in JavaScript.

Goal

The goal of this exercise is to teach the student how to handle errors / exception, throw them and create their own.

Learning objectives

  • try {} catch {}
  • throw Error
  • instanceOf SpecialError
  • Creating custom errors
    • Prefilling a message
    • Constructing a message based on some constructor value
    • Storing constructor values on the error (so that you have context)

Out of scope

  • Promise rejection
  • Throwing non-errors

Concepts

  • errors

Prerequisites

  • strings
  • classes-intro

After

Help

You can choose to do this solo-style, or collaborate with multiple people on this. My suggestion would be is to

  1. first accept this issue by saying "I'd like to work on this" (you will not get a response from me. Just go with it) and optionally request that someone works with you (and wait for a second person to accept your request).
  2. Use this issue to write down what you need (collect reference material) and discuss, if necessary, what to write and what not to write.
  3. Draft a PR and request the feedback from at least one other JavaScript member (I recommend just pinging the channel on slack).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions