CenterForDigitalHumanities / CenterForDigitalHumanities/TPEN-services

Error Handling and Throwing in Classes

Open
#479 0 comments 0 reactions 0 assignees View on GitHub
core-functionality enhancement
Dominant language
JavaScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The files in the classes/ directory are classified as Classes. They do not have access to the Express request and response stream.

The Classes are used heavily by routes and utility files. They help dictate what response code and message are returned by the endpoints.

Review all instances of error scenarios across the Classes. Errors within the Classes should be caught, handled, and thrown in a consistent manner. The routes and utility files can then catch and handle errors thrown by the Classes and pass them through to help determine the response to the client.

Review how the routes and utilities catch and handle errors in order to respond to the client. This may help you shape what an Error from the Classes should look like.

Contributor guide

Open the contributing guide

Research direction

Start by inventorying error scenarios in the classes/ directory, then read how the routes and utility files catch errors and determine endpoint responses. Define and apply a consistent error contract across the Classes, with routes and utilities able to catch and handle every class error consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.