CenterForDigitalHumanities / CenterForDigitalHumanities/TPEN28

Broken Message refactor

Open
#610 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Description

`transcribe.js` has at least one place where the `try... catch` is repeated over and over instead of just going up a level.

Here's an example of this pattern:

```js
if (data.KEY) {
try {
tpen.project.KEY= JSON.parse(data.KEY);
} catch (e) {
clearTimeout(longLoadingProject);
$(".turnMsg").html("Sorry! We had trouble fetching this project. Refresh the page to try again.");
$(".transLoader").find("img").attr("src", "../TPEN/images/BrokenBook01.jpg");
return false;
}
}
```

The `try` can definitely be pushed out one level or this can be a map on the keys, unless I am missing a bit.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in transcribe.js by locating the repeated try...catch blocks around project data parsing, using the KEY example in the issue as an entry point. Compare the existing error handling across keys and verify that the refactor preserves the loading timeout, error message, image change, and return behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.